auth0-oauth2-backend


Nameauth0-oauth2-backend JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/blend-ed/auth0-oauth2-backend
SummaryAn Open edX Python Social Auth backend for Tutor Auth0
upload_time2024-10-23 10:17:28
maintainerNone
docs_urlNone
authorZameel Hassan, zameel@blend-ed.com
requires_python>=3.10
licenseNone
keywords open edx oauth auth0
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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>"
                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"
      ]
    }

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/70361467-6fbb-40a7-ba2a-b7967a1b52f4
   :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/cd/30/626d5a27c5c07a36effaccdc251f79755c42ddeaed1c82c090580a7857e6/auth0_oauth2_backend-1.0.3.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                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    }\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/70361467-6fbb-40a7-ba2a-b7967a1b52f4\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.3",
    "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": "26892c271a0a6f88f82416df5a3ded5dcb5a1e7f0c41d0a3b1a987beabff9c6d",
                "md5": "ed04b970f450151f18d238fd483ac0c6",
                "sha256": "342ad0a1f5b247ae3a029609bf2ed03d1063dbb97cf23e40a7f3b4a93463e038"
            },
            "downloads": -1,
            "filename": "auth0_oauth2_backend-1.0.3-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ed04b970f450151f18d238fd483ac0c6",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.10",
            "size": 5307,
            "upload_time": "2024-10-23T10:17:26",
            "upload_time_iso_8601": "2024-10-23T10:17:26.773410Z",
            "url": "https://files.pythonhosted.org/packages/26/89/2c271a0a6f88f82416df5a3ded5dcb5a1e7f0c41d0a3b1a987beabff9c6d/auth0_oauth2_backend-1.0.3-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd30626d5a27c5c07a36effaccdc251f79755c42ddeaed1c82c090580a7857e6",
                "md5": "2e97871026fe8ac142ababe790e56625",
                "sha256": "dcf1348a1d7f65772a7016b3b5dec1d46abd7d7bebcb19ac0644f0aebcf23814"
            },
            "downloads": -1,
            "filename": "auth0_oauth2_backend-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2e97871026fe8ac142ababe790e56625",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 5846,
            "upload_time": "2024-10-23T10:17:28",
            "upload_time_iso_8601": "2024-10-23T10:17:28.869861Z",
            "url": "https://files.pythonhosted.org/packages/cd/30/626d5a27c5c07a36effaccdc251f79755c42ddeaed1c82c090580a7857e6/auth0_oauth2_backend-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-23 10:17:28",
    "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"
}
        
Elapsed time: 4.93786s