samly icon indicating copy to clipboard operation
samly copied to clipboard

Dynamically adding identity providers

Open jhchen opened this issue 7 years ago • 5 comments

Is there a recommended way to add identity providers at runtime? Currently we are doing Application.put_env(:samly, :identity_providers, identity_providers) and generating identity_providers from IdpData.load_providers/1 which doesn't feel like the cleanest since it has to re-generate existing identity providers.

Happy to contribute a PR if there is interest supporting an API to add a new identity provider at runtime. The use case for us is we allow users to integrate their Okta organization so different users Okta accounts ex. company1.okta.com and company2.okta.com which would correspond to company1.slab.com and company2.slab.com on our end. These would have different metadata XML files that we would add during runtime.

jhchen avatar Oct 16 '18 21:10 jhchen

The current config/metadata XML-in-files model may not be suitable in that dynamic world. I was thinking of addressing such a requirement after the 1.0 release.

A PR that could move Samly in that direction would be welcome.

handnot2 avatar Oct 17 '18 05:10 handnot2

Okay yes we are actually doing a hacky JIT writing to file right now but maybe we can just start with this. Will try to find some time in the next couple of weeks.

jhchen avatar Oct 18 '18 23:10 jhchen

@jhchen @handnot2 is there any progress on this?

kanes115 avatar Jun 13 '19 07:06 kanes115

I'm interested in this as well. I'm wondering if we can follow something similar that was done for the State where a behaviour is written. The first implementation could be a Config version where it does what Samly currently does now reading from the application environment.

Then we can build other implementations on top of that, such as databases, ets, ect...

@handnot2 thoughts?

tielur avatar Sep 16 '19 23:09 tielur