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

妖精的绣舞 提交于 2019-12-09 16:45:42

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/27146322/how-to-add-new-idp-metadata-in-spring-saml-at-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!