问题描述
我正在集成 spring-security-saml 扩展以在我的 web 应用程序中支持 SSO,我的应用程序应该允许不同的客户将他们的 IDP 元数据和他们的证书添加到我的 webapp(这是一个 SP),以便我的 webapp 可以启动针对他们的 idp 的 SSO.
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.
现在我正在我的 java 配置中定义一个元数据"bean,在其中我将 idp 元数据添加到 CachingMetadataManager.但这只会发生一次,我无法弄清楚如何在运行时向 MetadataManager 添加新的 idp 元数据(无需重新启动我的应用程序).我可以从 spring ApplicationContext 获取元数据 bean 并向其添加新的提供程序吗?它会起作用吗?
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?
使用 spring-SAML 支持上述用例(在运行时添加新的 idp)的一般做法是什么?有没有其他支持这个的java库.
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.
提前致谢
推荐答案
CachingMetadataManager
是同步的,您可以在运行时通过从应用程序上下文并调用 addMetadataProvider
/removeMetadataProvider
.
The CachingMetadataManager
is synchronized and you can add/remove MetadataProviders
during runtime by getting the bean from the application context and calling addMetadataProvider
/removeMetadataProvider
.
这篇关于如何在运行时在 spring-SAML 中添加新的 idp 元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!