Configure OAuth in Open edx
Configuring Open edX is very similar for Google, Facebook, LinkedIn, and Azure.
In the
lms.env.json
file, change the value ofFEATURES
>ENABLE_THIRD_PARTY_AUTH
totrue
(it isfalse
by default).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 theTHIRD_PARTY_AUTH_BACKENDS
list. By default, the file does not contain this list.If the
lms.env.json
file does not contain theTHIRD_PARTY_AUTH_BACKENDS
list, you do not have to complete any additional steps.If the
lms.env.json
file contains theTHIRD_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"
.
- For Google, add
If you are using a custom backend, add the applicable OAuth2 provider to the
THIRD_PARTY_AUTH_BACKENDS
list in thelms.env.json
file. If the file does not contain theTHIRD_PARTY_AUTH_BACKENDS
list, create the list, and then add the OAuth2 provider.
For more information, see the AWS template file file in GitHub.
In the
lms.auth.json
file, add the client secret. To do this, create theSOCIAL_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=" }
Restart the LMS server so that it will use the new settings.
Comments
Post a Comment