【问题标题】:Okta/Spring Boot Saml application enters infinite loopOkta/Spring Boot Saml 应用程序进入无限循环
【发布时间】:2018-10-25 10:48:54
【问题描述】:

我遵循了这个指南:

https://dzone.com/articles/get-started-with-spring-boot-saml-and-okta

一开始一切都很顺利。但随后应用程序进入了无限循环:在浏览器的 url 中,它重定向到 Okta 的登录页面,反之亦然。当我通过删除 cookie 清除 Chrome 中的浏览数据时,一切又开始正常工作。但有时无限循环再次上升。以下是一些例外情况:

2018-05-15 20:16:23.027  INFO 11136 --- [nio-8443-exec-1] 
o.s.security.saml.log.SAMLDefaultLogger  : AuthNResponse;FAILURE;0:0:0:0:0:0:0:1;https://localhost:8443/saml/metadata;http://www.okta.com/exkezd0f1qtnMMYy90h7;;;org.opensaml.common.SAMLException: Response doesn't have any valid assertion which would pass subject validation
at org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.processAuthenticationResponse(WebSSOProfileConsumerImpl.java:229)
at org.springframework.security.saml.SAMLAuthenticationProvider.authenticate(SAMLAuthenticationProvider.java:82)

...

Caused by: org.springframework.security.authentication.CredentialsExpiredException: Authentication statement is too old to be used with value 2018-05-15T11:46:27.900Z
at org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.verifyAuthenticationStatement(WebSSOProfileConsumerImpl.java:538)
at org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.verifyAssertion(WebSSOProfileConsumerImpl.java:306)
at org.springframework.security.saml.websso.WebSSOProfileConsumerImpl.processAuthenticationResponse(WebSSOProfileConsumerImpl.java:214)
... 64 more

请帮忙!

【问题讨论】:

    标签: java spring spring-boot spring-saml okta


    【解决方案1】:

    看起来您的服务器时钟比 UTC 早 8.5 小时,并且错误代码中的某处看起来是一个假设您在 UTC 中的检查,因此令牌已存在 8.5 小时并被拒绝,但 IDP 认为您是已经登录并有一个会话,所以每次只用一个新的语句回复,SP 每次都一遍又一遍地拒绝它。 更正时钟/找出问题出在哪里,如果系统针对另一个时区正确设置,可能会发生这种情况?

    【讨论】:

      猜你喜欢
      • 2021-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 2021-11-17
      • 2022-01-15
      • 2015-12-29
      • 1970-01-01
      相关资源
      最近更新 更多