Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for "SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS" #103

Open
harijay opened this issue Nov 21, 2018 · 2 comments
Open

Documentation for "SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS" #103

harijay opened this issue Nov 21, 2018 · 2 comments

Comments

@harijay
Copy link

harijay commented Nov 21, 2018

I want to restrict authentication to my app to only my company domain which uses Gsuite ( google apps for my domain/ Google work).[ I saw this post on stackoverflow that suggested using the

SOCIAL_AUTH_GOOGLE_OAUTH2_WHITELISTED_DOMAINS=["mycompany.com"] ](https://stackoverflow.com/questions/38566799/limit-google-oauth-access-to-one-domain-using-hd-param-django-python-social)

to restrict auth only to mycompany.com domain.

Although using this in my django app, settings.py it clearly works: I wanted to see how this is implemented and what the caveats on this approach are , but cannot see it mentioned in the documentation.

Can someone point me in the direction of how this is implemented or how better to restrict Google Oauth2 to only my domain.

Thanks
Hari

@cmelone
Copy link

cmelone commented Dec 9, 2018

https://python-social-auth.readthedocs.io/en/latest/configuration/settings.html#whitelists

@nijel nijel transferred this issue from python-social-auth/social-app-django Mar 16, 2022
@nijel
Copy link
Member

nijel commented Mar 16, 2022

The implementation is here: https://github.com/python-social-auth/social-core/blob/32d7bcf41dd0f21dc71cf14cb5a7373a7e522e88/social_core/backends/base.py#L148-L159

Help in improving existing documentation is always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants