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.
.. code-block:: yaml
OPENEDX_EXTRA_PIP_REQUIREMENTS:
- git+https://github.com/blend-ed/auth0-oauth2-backend.git
2. Configure your Open edX LMS application
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
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:
.. code-block:: python
{
"DOMAIN": <Your Auth0 domain>,
"DEFAULT_SCOPE": [
"openid",
"profile",
"email"
],
"logout_url": "https://YOUR_AUTHO_DOMAIN/logout?returnTo=YOUR_LMS_LOGOUT_URL"
}
Images
------
.. image:: https://github.com/user-attachments/assets/37ab6f4f-5c43-4ece-b53e-b1102c4457c5
:alt: Initial details section
:align: center
.. image:: https://github.com/user-attachments/assets/0cd7911e-382d-4891-965c-69cfa7b0e4b0
:alt: Options section
:align: center
.. image:: https://github.com/user-attachments/assets/31ae3af4-6728-4ff3-9ceb-a9b85d37fab2
:alt: Secrets section
:align: center
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
.. image:: https://github.com/user-attachments/assets/83714527-bada-44c3-a236-d2b8f1a32294
:alt: Allowed logout URLs
:align: center
Raw data
{
"_id": null,
"home_page": "https://github.com/blend-ed/auth0-oauth2-backend",
"name": "auth0-oauth2-backend",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "Open edX, oauth, Auth0",
"author": "Zameel Hassan, zameel@blend-ed.com",
"author_email": "Zameel Hassan <zameel@blend-ed.com>",
"download_url": "https://files.pythonhosted.org/packages/6f/7e/26b9342a77a03030dffb95f53ddb2de18972d17c8a620573f26c71b685f0/auth0_oauth2_backend-1.0.4.tar.gz",
"platform": null,
"description": "Overview\n--------\n\nThis 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.\n\nUsage\n-----\n\n1. Add this package to your project's requirements\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAdd this project to your extra pip requirements.\n\n.. code-block:: yaml\n\n OPENEDX_EXTRA_PIP_REQUIREMENTS:\n - git+https://github.com/blend-ed/auth0-oauth2-backend.git\n\n2. Configure your Open edX LMS application\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n from tutor import hooks\n\n hooks.Filters.ENV_PATCHES.add_items(\n [\n (\n \"openedx-common-settings\",\n \"\"\"\n AUTH0_DOMAIN = \"<YOUR_AUTH0_DOMAIN>\"\n AUTH0_AUDIENCE = \"<YOUR_AUTH0_AUDIENCE>\"\n EMAIL_DOMAIN = \"<Domain to be appended on the end of email (eg: email.com)>\"\n TPA_AUTOMATIC_LOGOUT_ENABLED = True\n \"\"\",\n ),\n (\n \"lms-env\",\n \"\"\"\n THIRD_PARTY_AUTH_BACKENDS: [\n \"auth0_oauth2.auth0.Auth0OAuth2\",\n \"social_core.backends.google.GoogleOAuth2\",\n \"common.djangoapps.third_party_auth.saml.SAMLAuthBackend\",\n \"django.contrib.auth.backends.ModelBackend\"\n ]\n SOCIAL_AUTH_AUTH0_PLUGIN_FIELDS_STORED_IN_SESSION:\n - \"auth_entry\"\n ADDL_INSTALLED_APPS:\n - \"auth0_oauth2\"\n \"\"\"\n ),\n (\n \"common-env-features\",\n \"\"\"\n ENABLE_THIRD_PARTY_AUTH: true\n \"\"\"\n )\n ]\n )\n\n3. Configure your Auth0 provider configurations\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis is the code to be placed in the other settings field:\n\n.. code-block:: python\n\n {\n \"DOMAIN\": <Your Auth0 domain>,\n \"DEFAULT_SCOPE\": [\n \"openid\",\n \"profile\",\n \"email\"\n ],\n \"logout_url\": \"https://YOUR_AUTHO_DOMAIN/logout?returnTo=YOUR_LMS_LOGOUT_URL\"\n }\n\nImages\n------\n\n.. image:: https://github.com/user-attachments/assets/37ab6f4f-5c43-4ece-b53e-b1102c4457c5\n :alt: Initial details section\n :align: center\n\n.. image:: https://github.com/user-attachments/assets/0cd7911e-382d-4891-965c-69cfa7b0e4b0\n :alt: Options section\n :align: center\n\n.. image:: https://github.com/user-attachments/assets/31ae3af4-6728-4ff3-9ceb-a9b85d37fab2\n :alt: Secrets section\n :align: center\n\n4. Configure your Auth0 application in Auth0 dashboard\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n- Go to your Auth0 dashboard\n- Click on settings and then go to the advanced settings\n- Add the logout URL of your Open edX instance in the allowed logout URLs\n\n.. image:: https://github.com/user-attachments/assets/83714527-bada-44c3-a236-d2b8f1a32294\n :alt: Allowed logout URLs\n :align: center\n",
"bugtrack_url": null,
"license": null,
"summary": "An Open edX Python Social Auth backend for Tutor Auth0",
"version": "1.0.4",
"project_urls": {
"Bug Tracker": "https://github.com/blend-ed/auth0-oauth2-backend/issues",
"Homepage": "https://github.com/blend-ed/auth0-oauth2-backend"
},
"split_keywords": [
"open edx",
" oauth",
" auth0"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1da8f3b5d9d6c8f27dfcf9fc6ada01b59c8886b3ad7c4e5f9c3f29268e8ae111",
"md5": "3984829e9b94b3a0239f770708d55382",
"sha256": "6c9b65466a0a581c16197c95cc73955fdd82c45bcd2cda1f64134e046db7d368"
},
"downloads": -1,
"filename": "auth0_oauth2_backend-1.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3984829e9b94b3a0239f770708d55382",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.10",
"size": 5399,
"upload_time": "2025-01-07T03:30:22",
"upload_time_iso_8601": "2025-01-07T03:30:22.508874Z",
"url": "https://files.pythonhosted.org/packages/1d/a8/f3b5d9d6c8f27dfcf9fc6ada01b59c8886b3ad7c4e5f9c3f29268e8ae111/auth0_oauth2_backend-1.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6f7e26b9342a77a03030dffb95f53ddb2de18972d17c8a620573f26c71b685f0",
"md5": "48337f3290dc72e80825731cb85e7eb3",
"sha256": "e91652359c14ffb8562a7c8c2fa0dc9435cb407c4f56654fbcad732a0092eed1"
},
"downloads": -1,
"filename": "auth0_oauth2_backend-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "48337f3290dc72e80825731cb85e7eb3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5945,
"upload_time": "2025-01-07T03:30:25",
"upload_time_iso_8601": "2025-01-07T03:30:25.902218Z",
"url": "https://files.pythonhosted.org/packages/6f/7e/26b9342a77a03030dffb95f53ddb2de18972d17c8a620573f26c71b685f0/auth0_oauth2_backend-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-07 03:30:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "blend-ed",
"github_project": "auth0-oauth2-backend",
"github_not_found": true,
"lcname": "auth0-oauth2-backend"
}