-
-
Notifications
You must be signed in to change notification settings - Fork 108
Add Auth0 OAuth2 backend documentation #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||
| Auth0 | ||||||||||
| ===== | ||||||||||
|
|
||||||||||
| Auth0 OAuth2 | ||||||||||
| ------------ | ||||||||||
|
|
||||||||||
| Auth0 provides OAuth2 authentication. This is the original ``Auth0OAuth2`` backend. | ||||||||||
|
|
||||||||||
| For a newer OpenID Connect implementation, see :doc:`auth0_openidconnect`. | ||||||||||
|
|
||||||||||
| Setup | ||||||||||
| ***** | ||||||||||
|
|
||||||||||
| To enable Auth0 OAuth2 support: | ||||||||||
|
|
||||||||||
| 1. Register your application at `Auth0 Dashboard`_ to get your Auth0 domain, | ||||||||||
| Client ID, and Client Secret. | ||||||||||
|
|
||||||||||
| 2. Fill in the settings with your Auth0 domain, Client ID, and Client Secret:: | ||||||||||
|
|
||||||||||
| SOCIAL_AUTH_AUTH0_KEY = '' | ||||||||||
| SOCIAL_AUTH_AUTH0_SECRET = '' | ||||||||||
| SOCIAL_AUTH_AUTH0_DOMAIN = 'yourdomain.auth0.com' | ||||||||||
|
|
||||||||||
| Replace ``yourdomain`` with your Auth0 tenant domain. | ||||||||||
|
|
||||||||||
| 3. Add the backend to your authentication backends:: | ||||||||||
|
|
||||||||||
| AUTHENTICATION_BACKENDS = ( | ||||||||||
| ... | ||||||||||
| 'social_core.backends.auth0.Auth0OAuth2', | ||||||||||
| ... | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| Scopes | ||||||||||
| ****** | ||||||||||
|
|
||||||||||
| You can define custom scopes using the ``SOCIAL_AUTH_AUTH0_SCOPE`` setting:: | ||||||||||
|
|
||||||||||
| SOCIAL_AUTH_AUTH0_SCOPE = ['openid', 'profile', 'email'] | ||||||||||
|
|
||||||||||
|
Comment on lines
+40
to
+41
|
||||||||||
| SOCIAL_AUTH_AUTH0_SCOPE = ['openid', 'profile', 'email'] | |
| SOCIAL_AUTH_AUTH0_SCOPE = 'openid profile email' | |
| You may also use a Python list (e.g., ``['openid', 'profile', 'email']``), but for consistency with other backends, a space-separated string is recommended. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ Social backends | |
| apple | ||
| appsfuel | ||
| arcgis | ||
| auth0 | ||
| auth0_openidconnect | ||
| azuread | ||
| battlenet | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setting name should be
AUTHENTICATION_BACKENDSnotSOCIAL_AUTH_AUTHENTICATION_BACKENDS. However, looking at other backend documentation files (e.g., apple.rst usesSOCIAL_AUTH_AUTHENTICATION_BACKENDS, azuread.rst usesAUTHENTICATION_BACKENDS, github.rst usesAUTHENTICATION_BACKENDS), there's inconsistency across the documentation. This file usesAUTHENTICATION_BACKENDSwhich matches github.rst and azuread.rst, so this is acceptable given the existing patterns.