ComponentSpace

Forums



How to 'refresh' SAML configuration stored in 'SAMLController.Configurations' added via...


How to 'refresh' SAML configuration stored in...

Author
Message
henilpatel
henilpatel
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)

Group: Forum Members
Posts: 3, Visits: 27
Hello,

We have multi tenanted system and we load configuration from DB when user access SSO/{tenantId}. We store tenantId as samlConfiguration.ID when User access SSO/{tenantId} as we dont want to load everything at same time in Global.asax. Couple of questions we have,
 1. We see multiple configurations in SAMLController.Configurations with same ID. Let's say 5 Users has accessed SSO/{tenantId} with same tenantId, We see 5 entries in SAMLController.Configurations with same id. We were under the impression that it should overwrite configuration if ID exists. So need to understand why that's the case?
2. How do we refresh those configurations in 'SAMLController.Configurations' when configuration changes for that tenantId without restarting server?

Thanks in advance!   
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
If you're refreshing a SAML configuration you should call SAMLController.Configurations.RemoveConfiguration before calling SAMLController.Configurations.AddConfiguration.

Alternatively, simply access the configuration in questions using SAMLController.Configurations.GetConfiguration and update it as required. We return a reference rather than a copy of the configuration so any changes that are made are picked up immediately.

Changes to SAMLController.Configurations don't require restarting the server. 

Regards
ComponentSpace Development
henilpatel
henilpatel
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)

Group: Forum Members
Posts: 3, Visits: 27
ComponentSpace - 4/3/2020
If you're refreshing a SAML configuration you should call SAMLController.Configurations.RemoveConfiguration before calling SAMLController.Configurations.AddConfiguration.

Alternatively, simply access the configuration in questions using SAMLController.Configurations.GetConfiguration and update it as required. We return a reference rather than a copy of the configuration so any changes that are made are picked up immediately.

Changes to SAMLController.Configurations don't require restarting the server. 

Thanks for the quick reply. Appreciate this.

For now I am looping through SAMLController.Configurations.Configurations and comparing the ID with updated SAMLConfiguration Id, if matches then calling Remove and adding back with Add. First I tried using SAMLController.Configurations.Configurations.Contains but somehow not getting expected results so swtiched to foreach.

Also, I tried SAMLController.Configurations.GetConfiguration to check whether configuration exists or not but if getting Exception if not found. So I am avoiding that and kind of sticking to above solution. But not liking this 'hard' refresh of removing and adding configurations :) 

Thanks!
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
Another option is to implement the ISAMLConfigurationResolver interface rather than manipulating SAMLController.Configurations.

This approach is documented in our Configuration Guide.

https://www.componentspace.com/Forums/9350/Configuration-Guide


Regards
ComponentSpace Development
henilpatel
henilpatel
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)

Group: Forum Members
Posts: 3, Visits: 27
ComponentSpace - 4/3/2020
Another option is to implement the ISAMLConfigurationResolver interface rather than manipulating SAMLController.Configurations.

This approach is documented in our Configuration Guide.

https://www.componentspace.com/Forums/9350/Configuration-Guide

Yea I am looking into that also but in that we have to change most of the current implementation so weighing my options here :)  Thanks for the help!
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
You're very welcome.

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