我目前正在从旧的弃用的Spring Security SAML扩展1.0.10迁移到Spring Security 5.6.1中的SAML实现。
在旧扩展中,有可能禁用SAML响应的签名验证(属性wantAssertionSigned
在Spring Security SAML Extension documentation中)。这对我在测试期间非常有帮助。
我想知道在Spring Security 5.6.1中是否也可以这样做?
我在源代码中搜索并找到了类OpenSamlMetadataResolver
,在我看来,这是硬编码的,无法更改:
private SPSSODescriptor buildSpSsoDescriptor(RelyingPartyRegistration registration) {
SPSSODescriptor spSsoDescriptor = build(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
(...)
spSsoDescriptor.setWantAssertionsSigned(true);
(...)
return spSsoDescriptor;
}
另外,OpenSaml4AuthenticationProvider
中的代码似乎没有提供一种简单的方法来配置私有变量 assertionSignatureValidator
以覆盖验证行为。
感谢任何帮助。