我正在寻找一种方法来增加我的 saml 消息的过期时间。我将 Spring Security 与 SAML 1.0.0-RC2 结合使用。
此时,如果服务器**时间相差太大,例如5 分钟后,出现以下错误:
HTTP Status 401 - Authentication Failed:Error validating SAML message: SAML response is not valid; nested exception is org.opensaml.common.SAMLException: SAML response is not valid
我想将到期时间设置为 10 分钟,以防止出现这些错误。我一直在看文档,但我不明白如何更改过期时间。如果我看 Configuration authentication object部分,可以更改到期时间,但我无法理解这个想法。
有人能帮帮我吗?
** 我的服务器(SP)和客户的服务器(IDP,很可能是安装了 ADFS 的服务器)。
最佳答案
Stefan 的回答后,我知道去哪里找了!实际上文档确实描述了这个东西,我只是没有把它捡起来:10.3 Validity intervals .感谢 Stefan 指出 responseSkew 属性!
只需将属性 responseSkew 添加到 WebSSOProfileConsumerImpl 和 SingleLogoutProfileImpl beans:
<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl">
<property name="responseSkew" value="600"/> <!-- 10 minutes -->
</bean>
<bean id="logoutprofile" class="org.springframework.security.saml.websso.SingleLogoutProfileImpl">
<property name="responseSkew" value="600"/> <!-- 10 minutes -->
</bean>
关于java - Spring security Saml - SP和IDP的时间差,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25647925/