ComponentSpace

Forums



Updating SamlConfigurations from singleton class


Updating SamlConfigurations from singleton class

Author
Message
keithpeck
keithpeck
New Member
New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)

Group: Awaiting Activation
Posts: 2, Visits: 8
Is it possible to update the SamlConfigurations from a singleton class. It looks like updating is now only possible through IOptionsSnapshot<SamlConfigurations> 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 
 
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
Hi Keith
We made some internal changes which now require this to be scoped rather than a singleton.
Could you implement IOptionsSnapshot<SamlConfigurations> 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.

Regards
ComponentSpace Development
keithpeck
keithpeck
New Member
New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)New Member (3 reputation)

Group: Awaiting Activation
Posts: 2, Visits: 8
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<SamlConfigurations> 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.

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 
ComponentSpace
ComponentSpace
ComponentSpace Development
ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)ComponentSpace Development (4.4K reputation)

Group: Administrators
Posts: 3.2K, Visits: 11K
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


Regards
ComponentSpace Development
GO


Similar Topics


Execution: 0.000. 2 queries. Compression Enabled.
Login
Existing Account
Email Address:


Password:


Select a Forum....












Forums, Documentation & Knowledge Base - ComponentSpace


Search