Updating SamlConfigurations from singleton class

Is it possible to update the SamlConfigurations from a singleton class. It looks like updating is now only possible through IOptionsSnapshot which requires a scoped class.

For context we have a singleton RabbitMQ consumer running in the background which listens for SAML changes published by other microservices and then updates the SamlConfigurations. This was possible in previous versions but does not work anymore in 2.0.4.

Thanks,
Keith

Hi Keith
We made some internal changes which now require this to be scoped rather than a singleton.
Could you implement IOptionsSnapshot using a scoped class which then retrieves configuration information through your RabbitMQ singleton class?
Alternatively, you could look at implementing ComponentSpace.Saml2.Configuration.Resolver.ISamlConfigurationResolver.

[quote]
ComponentSpace - 3/8/2018
Hi Keith
We made some internal changes which now require this to be scoped rather than a singleton.
Could you implement IOptionsSnapshot using a scoped class which then retrieves configuration information through your RabbitMQ singleton class?
Alternatively, you could look at implementing ComponentSpace.Saml2.Configuration.Resolver.ISamlConfigurationResolver.
[/quote]

I've been thinking about your first solution and can't see how that would work, but if ISamlConfigurationResolver allows us to get the saml configuration from the database each time it is accessed then we won't need to have a RabbitMQ setup to maintain in-memory configurations.

Thanks,
Keith

The ISamlConfigurationResolver is a good option if the SAML configuration is dynamic. We call through the interface to retrieve SAML configuration each time it’s required. In your implementation you can read it directly from the database.
Please refer to our Configuration Guide which includes a section on implementing ISamlConfigurationResolver.
https://www.componentspace.com/Forums/8234/Configuration-Guide