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

Per-tenant OAuth2 Credentials #938

Open
duplxey opened this issue Oct 11, 2024 · 0 comments
Open

Per-tenant OAuth2 Credentials #938

duplxey opened this issue Oct 11, 2024 · 0 comments

Comments

@duplxey
Copy link

duplxey commented Oct 11, 2024

I have a multi-tenant Django app created using the django-tenants package. I successfully setup "global" social authentication using social_core.backends.google.GoogleOAuth2 backend.

Now, I'd like to allow tenants to provide their own Google OAuth2 credentials (client_id & client_secret) and authenticate through their own Google apps. Is there any way I can enable per tenant OAuth2 credentials? I'm talking about these two settings:

# these are global, but i'd like each tenant to have their own creds
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = "<google_client_id>"
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = "<google_client_secret>"

I also tried dynamically changing these two settings, but it looks like they're only evaluated on Django server startup (and then cached somewhere).

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

1 participant