spring - Spring SAML 安全证书缓存问题
问题描述
我正在使用 Spring security SAML 1.0.3 Release 版本。我发现了一个问题,如果我们为 IDP 上传证书,它不会反映在 Spring SAML 中。问题似乎出 在有缓存 Map 的MetadataCredentialResolver上
Map<MetadataCacheKey, SoftReference<Collection<Credential>>> cache;
它从缓存中挑选证书,因此新上传的证书被忽略。有没有办法重置缓存?
解决方案
我认为摆脱缓存的方法是覆盖一个类并使其为所有与缓存相关的调用将值设置为 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
}
推荐阅读
- c# - 从一个线程读取变量并从另一个线程写入的正确方法?
- firebase - Firebase 数据库规则设置为所有者只读
- prolog - 谓词与函数 PROLOG
- php - PHP标头重新加载当前页面
- android - 如何检查按钮当前是否在颤动中处于活动状态?
- android - 使用行和列中的动态数据对 PaginatedDataTable 进行排序
- ios - UITextView - 根据 SwiftUI 中的内容调整大小
- c - Valgrind 报告从标准输入的 getline 后释放指针的内存泄漏
- numpy - 错误:“不能将标量组件 'PVtoB' 视为索引组件”
- java - 如何在mac yosemite上使用模拟器在android studio中修复“库未加载:/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage”?