edx-auth-backends

raw JSON →
5.0.0 verified Mon Apr 27 auth: no python

Custom authentication backends and pipeline steps for Open edX. Version 5.0.0 adds Django 5.2 support and drops Python 3.8 and 3.11. Release cadence is irregular; maintained by the Open edX community.

pip install edx-auth-backends
error ModuleNotFoundError: No module named 'edx_auth_backends'
cause Package not installed or wrong Python environment.
fix
Run 'pip install edx-auth-backends' and activate correct virtualenv.
error ImportError: cannot import name 'EdXOpenIdConnect' from 'edx_auth_backends'
cause Incorrect import path or version mismatch.
fix
Use 'from edx_auth_backends.open_id_connect import EdXOpenIdConnect' (submodule added in v4.0).
error TypeError: __init__() got an unexpected keyword argument 'redirect_uri'
cause Outdated social-auth-core version incompatible with current backends.
fix
Upgrade social-auth-core to >=4.4.0.
breaking Python 3.8 and 3.11 support dropped in v5.0.0.
fix Use Python 3.9, 3.10, or 3.12+.
breaking Django 5.2 is supported; older Django versions may not work.
fix Ensure Django 5.2+ is installed.
breaking RemovedInDjango40Warning: django.conf.urls.url and include deprecated. Fixed in v4.0.1 but may reappear if using older versions.
fix Upgrade to v4.0.1+ or replace with django.urls.path/re_path.
breaking Social auth pipeline steps changed in v4.0. Backends no longer inherit from deprecated classes.
fix Update custom pipeline steps to use current social-auth-core API.

Basic configuration for Open edX SSO using OpenID Connect.

# settings.py
INSTALLED_APPS = [
    ...
    'social_django',
    'edx_auth_backends',
]

AUTHENTICATION_BACKENDS = [
    'edx_auth_backends.backends.EdXOpenIdConnect',
    'django.contrib.auth.backends.ModelBackend',
]

SOCIAL_AUTH_EDX_OAUTH2_KEY = os.environ.get('EDX_OAUTH2_KEY', '')
SOCIAL_AUTH_EDX_OAUTH2_SECRET = os.environ.get('EDX_OAUTH2_SECRET', '')
# See docs for full pipeline settings.