3

我正在使用 spring-security-saml2 api 来建立连接。

它在一段时间内运行良好,但最近我在响应标头中的日期遇到了一些麻烦。当org.springframework.security.saml.SAMLProcessingFilter调用过滤器 (url -> /saml/SSO/alias/defaultAlias) 时,响应包含一个标头date,并且此日期有时会晚 2 小时。

因此我收到一个错误Etat HTTP 401 - Authentication Failed : Response issue time is either too old or with date in the future, skew 60, time 2014-10-22T08:25:55.967Z(在 10h25 测试)

我不知道如何检索日期以及为什么这种行为只会定期发生。我正在寻找任何线索。谢谢。

4

1 回答 1

6

你在哪个时区?2014-10-22T08:25:55.967Z是 UTC,因此您的当地时间之间的 2 小时差异可以通过 GMT+2(例如法国夏令时)来解释。

我的猜测是您的 IDP 和 SP 之间的时钟未正确同步,有时创建 Response 对象(2014-10-22T08:25:55.967Z)与您的 SP 机器上的时间之间的时间差超过 60 秒。

尝试更改您的WebSSOProfileConsumerImplbean并将其声明如下,它可能会解决您的问题:

<bean id="webSSOprofileConsumer" class="org.springframework.security.saml.websso.WebSSOProfileConsumerImpl">
    <property name="responseSkew" value="180"/>
</bean>
于 2014-10-25T07:02:45.327 回答