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>"
            EMAIL_DOMAIN = "<Domain to be appended on the end of email (eg: email.com)>"
            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"
  ],
  "logout_url": "https://YOUR_AUTHO_DOMAIN/logout?returnTo=YOUR_LMS_LOGOUT_URL"
}

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.4.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auth0_oauth2_backend-1.0.4-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: auth0_oauth2_backend-1.0.4.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for auth0_oauth2_backend-1.0.4.tar.gz
Algorithm Hash digest
SHA256 e91652359c14ffb8562a7c8c2fa0dc9435cb407c4f56654fbcad732a0092eed1
MD5 48337f3290dc72e80825731cb85e7eb3
BLAKE2b-256 6f7e26b9342a77a03030dffb95f53ddb2de18972d17c8a620573f26c71b685f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for auth0_oauth2_backend-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6c9b65466a0a581c16197c95cc73955fdd82c45bcd2cda1f64134e046db7d368
MD5 3984829e9b94b3a0239f770708d55382
BLAKE2b-256 1da8f3b5d9d6c8f27dfcf9fc6ada01b59c8886b3ad7c4e5f9c3f29268e8ae111

See more details on using hashes here.

Supported by

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