Skip to content

Commit

Permalink
Merge pull request #206 from smatyas/auth0-custom-domain
Browse files Browse the repository at this point in the history
added the custom_domain parameter to the auth0 client library config
  • Loading branch information
weaverryan authored Oct 28, 2019
2 parents 1ecb9f9 + ecf50e8 commit e8974c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
# 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
Expand Down
12 changes: 11 additions & 1 deletion src/DependencyInjection/Providers/Auth0ProviderConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ class Auth0ProviderConfigurator implements ProviderConfiguratorInterface
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')
->isRequired()
->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()
;
}

Expand All @@ -34,7 +42,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'],
];
}

Expand Down

0 comments on commit e8974c5

Please sign in to comment.