Configure OAuth in Open edx

 Configuring Open edX is very similar for Google, Facebook, LinkedIn, and Azure.

  1. In the lms.env.json file, change the value of FEATURES > ENABLE_THIRD_PARTY_AUTH to true (it is false by default).

  2. If necessary, make sure that the correct backend is specified.

    • If you are using Google, Facebook, LinkedIn, or Active Directory, open the lms.env.json file and look for the THIRD_PARTY_AUTH_BACKENDS list. By default, the file does not contain this list.

      If the lms.env.json file does not contain the THIRD_PARTY_AUTH_BACKENDS list, you do not have to complete any additional steps.

      If the lms.env.json file contains the THIRD_PARTY_AUTH_BACKENDS list, add the backend for the applicable IdP to the list.

      • For Google, add "social_core.backends.google.GoogleOAuth2".
      • For Facebook, add "social_core.backends.facebook.FacebookOAuth2".
      • For LinkedIn, add "social_core.backends.linkedin.LinkedinOAuth2".
      • For Azure Active Directory, add
        "social_core.backends.azuread.AzureADOAuth2".
    • If you are using a custom backend, add the applicable OAuth2 provider to the THIRD_PARTY_AUTH_BACKENDS list in the lms.env.json file. If the file does not contain the THIRD_PARTY_AUTH_BACKENDS list, create the list, and then add the OAuth2 provider.

    For more information, see the AWS template file file in GitHub.

  3. In the lms.auth.json file, add the client secret. To do this, create the SOCIAL_AUTH_OAUTH_SECRETS key if the key does not already exist, and then add the appropriate value for your IdP.

    Note

    If you are using Ansible, set the EDXAPP_SOCIAL_AUTH_OAUTH_SECRETS variable.

    • For Google, add the following value.

      "SOCIAL_AUTH_OAUTH_SECRETS": { "google-oauth2":
         "abcdef123456789101112131" }
      
    • For Facebook, add the following value.

      "SOCIAL_AUTH_OAUTH_SECRETS": {
         "facebook": "98765432181bbe3a2596efa8ba7abcde"
      }
      
    • For LinkedIn, add the following value.

      "SOCIAL_AUTH_OAUTH_SECRETS": { "linkedin-oauth2": "4D3Cb2aB1C0dEFGH" }
      
    • For Azure, add the following value.

      "SOCIAL_AUTH_OAUTH_SECRETS": { "azuread-oauth2":
          "abcdef12341yHlmOrR8D3vlV1cD2VtL7k9xk9DSB8vw=" }
      
  4. Restart the LMS server so that it will use the new settings.

Comments

Popular posts from this blog

Types of Computers - Basic Computers

Checking the node.js version in MAC