OTA-Insight / djangosaml2idp

SAML 2.0 Identity Provider in Django
Apache License 2.0
104 stars 97 forks source link

Dynamic configuration loading #107

Open okke-formsma opened 4 years ago

okke-formsma commented 4 years ago

We're using djangosaml2's dynamic configuration loading feature, and would like to be able to use something similar for djangosaml2idp. Is this a feature on the roadmap, or would you be open to pull requests?

Instead of hardcoding the idp settings in the config file, a callable is defined which returns a dictionary with the contents of SAML_IDP_CONFIG: SAML_IDP_CONFIG_LOADER = 'python.path.to.your.callable'

Thanks for the great package!

challet commented 3 years ago

I'm trying to come up with something similar. The main difficulty here resides in the ServiceProvider model which uses IDP.load() (more or less the config loading) but where the HttpRequest is not accessible (in djangosaml2 it is passed to the callable).

Amertz08 commented 3 years ago

I'm going to bump this. We're in the process of trying to externalize all our configs on our IDP so we don't have to redeploy every time we want something to change. This would be nice feature to avoid that happening.

challet commented 3 years ago

I'm trying a PR about this : #126. It may need some further testing for various usages.