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

Multiple backend of the same type or DB driven settings #374

Open
vahidkowsari opened this issue Jun 17, 2022 · 5 comments
Open

Multiple backend of the same type or DB driven settings #374

vahidkowsari opened this issue Jun 17, 2022 · 5 comments

Comments

@vahidkowsari
Copy link

Hi,

This is just a general question as to how to use this library. We have started using this library for our application and using keycloak, OIDC and Okta configurations. We are a multitenant platform that needs to have multiple OIDC client apps each integrated into our system with each using different ID providers authoenticating the users which drop into users with different roles and organizations in our system.

The way I understand it is that currently thse OAUTH2 apps are to be configured in the django settings. I have looked into developing our own strategy and part ways thru that but also realize that in order to return settings for each of those backends additional work needs to be done. In addition the default PSA endpoints dont take any parameters for the backend so you could only have that backend once in the system.

Is what I am describing possible to do? Are there any genernal platform implementations of PSA with django that can do this?

Thanks

@digismack
Copy link

Hello! Yes, this is 100% possible to do. At work we use a DynamoDB table to store configuration objects for various customers. We can then call those configurations up by customer id and generate whatever links are needed to send the user over to the IdP. I'm not aware of any general platform implementations of this, but it is for sure possible with a little elbow grease.

@vahidkowsari
Copy link
Author

Great Thanks @digismack,
Do you have some general suggestion on how to do this? I think we are mainly overriridng our own strategy to read the backends and their config and turn those into settings for PSA. Is that you did?

@digismack
Copy link

Great Thanks @digismack, Do you have some general suggestion on how to do this? I think we are mainly overriridng our own strategy to read the backends and their config and turn those into settings for PSA. Is that you did?

Yep! Customizing your applications Strategy class, particularly overriding the get_setting method, is a good way to supplant the default settings-based lookup in the Django sample app with your own custom configuration management.

@ShaheedHaque
Copy link

ShaheedHaque commented Jan 5, 2023

See what I did on StackOverflow. I hope that helps...OTOH, I am not an expert, so I may done done something terribly wrong...

@johnnymetz
Copy link

Any tips on overriding the strategy for a single backend? I see the SOCIAL_AUTH_STRATEGY but that appears to override the strategy for all backends.

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

4 participants