Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add new idp metadata in spring-SAML at runtime

I am integrating spring-security-saml extension to support SSO in my web-application, my application should allow different customers to add their IDP metadata and their certificate to my webapp (which is an SP) so that my webapp can initiate SSO against their idp.

Right now I am defining a "metadata" bean in my java config where in I add the idp metadata to CachingMetadataManager. But this happens only once, I am not able to figure out how do I add a new idp metadata to MetadataManager at runtime (without re-starting my app). Can I just get the metadata bean from spring ApplicationContext and add a new provider to it? Will it work?

What is the general practice to support the above use case (adding new idp's at runtime) with spring-SAML? are there any other java libraries which support this.

Thanks in advance

like image 806
Rahul Avatar asked Nov 26 '14 10:11

Rahul


1 Answers

The CachingMetadataManager is synchronized and you can add/remove MetadataProviders during runtime by getting the bean from the application context and calling addMetadataProvider/removeMetadataProvider.

like image 174
Vladimír Schäfer Avatar answered Nov 02 '22 01:11

Vladimír Schäfer