【问题标题】:Spring SAML Security Certificate Caching IssueSpring SAML 安全证书缓存问题
【发布时间】:2020-05-17 06:19:04
【问题描述】:

我使用的是 Spring security SAML 1.0.3 Release 版本。我发现了一个问题,如果我们为 IDP 上传证书,它不会反映在 Spring SAML 中。 问题似乎出在 MetadataCredentialResolver 那里有一个缓存 Map

  Map<MetadataCacheKey, SoftReference<Collection<Credential>>> cache;

它正在从缓存中挑选证书,因此新上传的证书被忽略。有没有办法重置缓存?

【问题讨论】:

    标签: spring spring-security spring-security-saml2


    【解决方案1】:

    我认为摆脱缓存的方法是重写一个类,并将所有与缓存相关的调用的值设置为 null:-

    @Override
    protected Collection<Credential> retrieveFromCache(MetadataCacheKey cacheKey) 
    {
        //return null and let it fetch from metadata
        return null;
    }
    @Override
    protected void cacheCredentials(MetadataCacheKey cacheKey, 
    Collection<Credential> credentials) {
       //do not put anything into cache
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-02
      • 2015-06-10
      • 2017-02-15
      • 2015-10-10
      • 2011-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多