From 8b645ff50447e947c255fd0bf0a3f2803ca899eb Mon Sep 17 00:00:00 2001 From: Matyas Somfai Date: Tue, 15 Oct 2019 11:31:49 +0200 Subject: [PATCH 1/3] added the custom_domain parameter to the auth0 client library config --- README.md | 4 ++++ .../Providers/Auth0ProviderConfigurator.php | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8f8b6c26..cf2556ff 100644 --- a/README.md +++ b/README.md @@ -470,8 +470,12 @@ knpu_oauth2_client: # a route name you'll create redirect_route: connect_auth0_check redirect_params: {} + # Your custom/definite Auth0 domain, e.g. "login.mycompany.com". Set this if you use Auth0's Custom Domain feature. The "account" and "region" parameters will be ignored in this case. + custom_domain: null # Your Auth0 domain/account, e.g. "mycompany" if your domain is "mycompany.auth0.com" account: null + # Your Auth0 region, e.g. "eu" if your tenant is in the EU. + # region: null # whether to check OAuth2 "state": defaults to true # use_state: true diff --git a/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php b/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php index 34249f14..bc65b2de 100644 --- a/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php +++ b/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php @@ -17,10 +17,15 @@ class Auth0ProviderConfigurator implements ProviderConfiguratorInterface public function buildConfiguration(NodeBuilder $node) { $node + ->scalarNode('custom_domain') + ->info('Your custom/definite Auth0 domain, e.g. "login.mycompany.com". Set this if you use Auth0\'s Custom Domain feature. The "account" and "region" parameters will be ignored in this case.') + ->end() ->scalarNode('account') - ->isRequired() ->info('Your Auth0 domain/account, e.g. "mycompany" if your domain is "mycompany.auth0.com"') ->end() + ->scalarNode('region') + ->info('Your Auth0 region, e.g. "eu" if your tenant is in the EU.') + ->end() ; } @@ -34,7 +39,9 @@ public function getProviderOptions(array $config) return [ 'clientId' => $config['client_id'], 'clientSecret' => $config['client_secret'], + 'customDomain' => $config['custom_domain'], 'account' => $config['account'], + 'region' => $config['region'], ]; } From edb9ff53fe1081178d6edb962c4633113d019387 Mon Sep 17 00:00:00 2001 From: Matyas Somfai Date: Tue, 15 Oct 2019 11:43:55 +0200 Subject: [PATCH 2/3] added default null values --- .../Providers/Auth0ProviderConfigurator.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php b/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php index bc65b2de..dad001a9 100644 --- a/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php +++ b/src/DependencyInjection/Providers/Auth0ProviderConfigurator.php @@ -18,12 +18,15 @@ public function buildConfiguration(NodeBuilder $node) { $node ->scalarNode('custom_domain') + ->defaultNull() ->info('Your custom/definite Auth0 domain, e.g. "login.mycompany.com". Set this if you use Auth0\'s Custom Domain feature. The "account" and "region" parameters will be ignored in this case.') ->end() ->scalarNode('account') + ->defaultNull() ->info('Your Auth0 domain/account, e.g. "mycompany" if your domain is "mycompany.auth0.com"') ->end() ->scalarNode('region') + ->defaultNull() ->info('Your Auth0 region, e.g. "eu" if your tenant is in the EU.') ->end() ; From ecf50e871ac3e987d2544ec807b07d0d3f01f25a Mon Sep 17 00:00:00 2001 From: Matyas Somfai Date: Wed, 16 Oct 2019 11:56:38 +0200 Subject: [PATCH 3/3] updated readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf2556ff..9810dc31 100644 --- a/README.md +++ b/README.md @@ -471,9 +471,9 @@ knpu_oauth2_client: redirect_route: connect_auth0_check redirect_params: {} # Your custom/definite Auth0 domain, e.g. "login.mycompany.com". Set this if you use Auth0's Custom Domain feature. The "account" and "region" parameters will be ignored in this case. - custom_domain: null + # custom_domain: null # Your Auth0 domain/account, e.g. "mycompany" if your domain is "mycompany.auth0.com" - account: null + # account: null # Your Auth0 region, e.g. "eu" if your tenant is in the EU. # region: null # whether to check OAuth2 "state": defaults to true