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

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

Now I define the "metadata" of the bean in my java configuration, where I add the idp metadata to the CachingMetadataManager. But this happens only once, I cannot figure out how to add new idp metadata to the MetadataManager at runtime (without restarting my application). Can I just get the bean metadata from spring ApplicationContext and add a new provider to it? Will this work?

What is the general practice of supporting the above use case (adding a new idp at runtime) using spring-SAML? are there any other java libraries that support this.

Thanks in advance

+5
source share
1 answer

CachingMetadataManager synchronized, and you can add / remove MetadataProviders at runtime by getting a bean from the application context and calling addMetadataProvider / removeMetadataProvider .

+6
source

Source: https://habr.com/ru/post/1207727/


All Articles