I want to disable public registration form and allow login/registration through Google only.
But Now when i go to login page and click on “Show Me other ways to sign in” and then click to “Create an Account” i can see the normal registration page (HOW TO DISABLE THIS).
ALSO after clicking on “Show Me other ways to sign in” it takes me to normal signin page and if i refresh the page it goes back to hinted sign in page
How to Hide/Disable normal registration pages completely
In the past, the way I’ve done this is via a custom theme, by overriding the register and login underscore templates.
But now that I look at them, I can see that the behavior you want can be controlled via the ALLOW_PUBLIC_ACCOUNT_CREATION feature flag. Does that help?
@arbrandes I cannot set ALLOW_PUBLIC_ACCOUNT_CREATION = True as after Google login it needs few registration steps to create a account and link google account to edx but this flag completely remove registration pages and google login fails
Check that your OAuth Provider Configuration is “Enabled ( )” as well as “Visible ( )”
It probably is, but worth verifying.
THIRD_PARTY_AUTH_HINT must match the provider_id, which is composed of the OAuth2 prefix oa2- and the “Provider slug” set on /admin/third_party_auth/oauth2providerconfig.
If your slug is google-oauth2, then the setting you used above should work, but if not, then it needs to be changed.
THIRD_PARTY_AUTH_HINT: oa2-google-oauth2
All the sites we manage that use the THIRD_PARTY_AUTH_HINT use the Site Configuration in Django Admin to set this value, not the settings.FEATURES. From the code, there’s no good reason why this would be, but I’m noting it anyway.
(It takes 3 minutes for site configuration changes made in Django Admin to register because of caching.)