-
Notifications
You must be signed in to change notification settings - Fork 96
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
Allow receiving raw XML metadadata with IDP config #37
base: master
Are you sure you want to change the base?
Conversation
Do you have the need to add IdP provider dynamically? There is an issue related to that: #29. |
Yes, that is our use case |
I am planning to get to these PRs once the v1.0 release is out. Thanks for your patience. |
No problem, at the time we're using fork. Thank you ;) |
4a1cea8
to
3d883c8
Compare
@handnot2 I have fixed conflicts with current master |
Hi @hodak, may I ask how do you use this for your use case? (load IdP from DB) do you use a completely separate flow? meaning that you do not use the provided Samly plugs, store, etc, and instead roll your own consumer action and use the underlaying modules of Samly there? Looking into how to load IdP from DB myself :) |
@messutied No, we pretty much use everything as-is, we just have a GenServer worker in our supervision tree (so it's called right after app boots), that does something like this: defp do_perform do
idps =
query_active_idps_from_db()
|> Enum.map(fn idp ->
Map.merge(default_opts, %{
id: idp.subdomain,
metadata: idp.metadata_xml,
sp_id: idp.entity_id
})
end)
new_env =
Application.get_env(:samly, Samly.Provider, []) |> Keyword.put(:identity_providers, idps)
Application.put_env(:samly, Samly.Provider, new_env)
Samly.Provider.refresh_providers()
end and we have a way to trigger this refresh after identity provider changes in the database. Remember that if you have multiple nodes, you must call the refresh on each one of them. This PR is also relevant: #38 |
Thanks a lot @hodak! very helpful. |
Hi, we have a case where we store IdPs in database, instead of config file. It allows us to store metadata with a db record.