Skip to main content

An Open edX Python Social Auth backend for Tutor Auth0

Project description

Overview

This is a custom backend for Open edX that allows users to authenticate using Auth0. It also supports OTP login for users who have enabled it in their Auth0 account.

Usage

1. Add this package to your project’s requirements

Add this project to your extra pip requirements.

OPENEDX_EXTRA_PIP_REQUIREMENTS:
  - git+https://github.com/blend-ed/auth0-oauth2-backend.git

2. Configure your Open edX LMS application

from tutor import hooks

hooks.Filters.ENV_PATCHES.add_items(
    [
        (
            "openedx-common-settings",
            """
            AUTH0_DOMAIN = "<YOUR_AUTH0_DOMAIN>"
            AUTH0_AUDIENCE = "<YOUR_AUTH0_AUDIENCE>"
            TPA_AUTOMATIC_LOGOUT_ENABLED = True
            """,
        ),
        (
            "lms-env",
            """
            THIRD_PARTY_AUTH_BACKENDS: [
                "auth0_oauth2.auth0.Auth0OAuth2",
                "social_core.backends.google.GoogleOAuth2",
                "common.djangoapps.third_party_auth.saml.SAMLAuthBackend",
                "django.contrib.auth.backends.ModelBackend"
            ]
            SOCIAL_AUTH_AUTH0_PLUGIN_FIELDS_STORED_IN_SESSION:
            - "auth_entry"
            ADDL_INSTALLED_APPS:
            - "auth0_oauth2"
            """
        ),
        (
            "common-env-features",
            """
            ENABLE_THIRD_PARTY_AUTH: true
            """
        )
    ]
)

3. Configure your Auth0 provider configurations

This is the code to be placed in the other settings field:

{
  "DOMAIN": <Your Auth0 domain>,
  "DEFAULT_SCOPE": [
    "openid",
    "profile",
    "email"
  ]
}

Images

Initial details section Options section Secrets section

4. Configure your Auth0 application in Auth0 dashboard

  • Go to your Auth0 dashboard

  • Click on settings and then go to the advanced settings

  • Add the logout URL of your Open edX instance in the allowed logout URLs

Allowed logout URLs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auth0_oauth2_backend-1.0.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

auth0_oauth2_backend-1.0.3-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file auth0_oauth2_backend-1.0.3.tar.gz.

File metadata

  • Download URL: auth0_oauth2_backend-1.0.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for auth0_oauth2_backend-1.0.3.tar.gz
Algorithm Hash digest
SHA256 dcf1348a1d7f65772a7016b3b5dec1d46abd7d7bebcb19ac0644f0aebcf23814
MD5 2e97871026fe8ac142ababe790e56625
BLAKE2b-256 cd30626d5a27c5c07a36effaccdc251f79755c42ddeaed1c82c090580a7857e6

See more details on using hashes here.

File details

Details for the file auth0_oauth2_backend-1.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for auth0_oauth2_backend-1.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 342ad0a1f5b247ae3a029609bf2ed03d1063dbb97cf23e40a7f3b4a93463e038
MD5 ed04b970f450151f18d238fd483ac0c6
BLAKE2b-256 26892c271a0a6f88f82416df5a3ded5dcb5a1e7f0c41d0a3b1a987beabff9c6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page