To connect Auth0 to your Django project, follow these steps:
- Add the social authentication app to INSTALLED_APPS in the settings file, like so:
# myproject/settings/_base.pyINSTALLED_APPS = [ # … "social_django",]
- Now, add the Auth0 settings required by the social_django app, which will be similar to the following:
# myproject/settings/_base.pySOCIAL_AUTH_AUTH0_DOMAIN = get_secret("AUTH0_DOMAIN")SOCIAL_AUTH_AUTH0_KEY = get_secret("AUTH0_KEY")SOCIAL_AUTH_AUTH0_SECRET = get_secret("AUTH0_SECRET")SOCIAL_AUTH_AUTH0_SCOPE = ["openid", "profile", "email"]SOCIAL_AUTH_TRAILING_SLASH = False
Make sure that you define AUTH0_DOMAIN, AUTH0_KEY, and AUTH0_SECRET in your secrets or environment variables. The values for those variables ...