merzl
February 1, 2023, 7:37pm
1
Hi, I need to enable google oauth and here is what I tried:
Created tutor plugin with
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_items([
(
"common-env-features",
'"ENABLE_THIRD_PARTY_AUTH": true',
),
(
"common-env-features",
'"ENABLE_COMBINED_LOGIN_REGISTRATION": true',
),
(
"openedx-auth",
"'SOCIAL_AUTH_OAUTH_SECRETS': {'google-oauth2': 'my_key'}"
),
(
"lms-env",
"'THIRD_PARTY_AUTH_BACKENDS': ['social_core.backends.google.GoogleOAuth2']"
),
])
Enabled it, restarted tutor
2. Added configuration in django admin panel as stated here
https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/tpa/tpa_integrate_open/tpa_oauth.html#add-the-provider-configuration
But I still can’t get google auth button on login page, what is the best way to enable it?
Logs show no errors
arbrandes
(Adolfo R. Brandes)
February 2, 2023, 2:25pm
2
Can you confirm you went through these steps in particular?
In any case, are you familiar with your browser’s developer tools? On the network tab and after reloading the authentication page, can you find requests to /api/mfe_context
in your LMS instance? What does the server response to that request consist of?
You should be able to find Google listed in a JSON list named "providers"
. Whether it’s there or not will inform you whether the LMS is instructing the MFE to display the proper SSO button. (In other words, if it’s not there, the problem is in the backend.)
sambapete
(Pierre Mailhot)
February 2, 2023, 6:30pm
3
But more important than anything else, have you configured your keys at Google in order to support oauth2 in Open edX?
It doesn’t happen magically. You need to follow these instructions:
Setting up OAuth 2.0 - Google Cloud Platform Console Help .
1 Like
sambapete
(Pierre Mailhot)
February 2, 2023, 6:34pm
4
And make sure that your THIRD_PARTY_AUTH_BACKENDS is in the openedx-lms-common-settings patch in your plugins. That’s where we put it in.
1 Like
Danh_Vo
(Danh Vo)
August 17, 2024, 1:36pm
5
If the /api/mfe_content return current provider = null, then how could I fix it?
allen_luna
(allen luna)
December 3, 2024, 9:02pm
6
Hi @merzl
Did you fix it? if yes, what did you do? I am using quince mfe version 17.0.0
I have the same issue.
Thank you
zemogle
(Edward G)
February 27, 2025, 3:47pm
7
Has this been removed in Sumac? I can’t see it in the code .