【问题标题】:STORMPATH : Token is invalid because the 'issued at' time (iat) is later than the current server timeSTORMPATH:令牌无效,因为“发布于”时间 (iat) 晚于当前服务器时间
【发布时间】:2017-02-18 07:19:59
【问题描述】:

我正在尝试将 Spring Security(在 Spring Boot 之上)与 StormPath 集成。

一切正常,但一旦用户成功登录,就会抛出以下错误:

Sat Feb 18 12:43:27 IST 2017
There was an unexpected error (type=Internal Server Error, status=500).
com.stormpath.sdk.resource.ResourceException: HTTP 400, Stormpath 10012 (https://docs.stormpath.com/rest/product-guide/latest/errors.html#error-10012), RequestId 7e042da0-f5a9-11e6-afb8-22000be1c7ec: Token is invalid because the 'issued at' time (iat: 2017-02-18T07:13:27.000Z) is later than the current server time (2017-02-18T07:12:39.000Z).

Error Documentation

但是在手动重定向到默认的身份验证成功 URL(在我的情况下,它只是 http://localhost:8080)时,它成功地显示了注销按钮,并且它也可以正常工作。

以下是目前的代码:

@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.apply(stormpath());
    }   
}

application.properties:

stormpath.client.apiKey.id = xxxx
stormpath.client.apiKey.secret = xxxxx

我还需要做什么来克服这个错误?

【问题讨论】:

    标签: spring-boot spring-security spring-security-oauth2 stormpath


    【解决方案1】:

    您提供的令牌似乎有错误的时间戳,它声称将来会发行。

    时间差大约是一分钟,所以当你手动尝试时,那一分钟已经过去了,这可能是手动重定向起作用的原因。

    我认为除了通知该服务的提供商调整他们的服务器时间之外,您无能为力。

    【讨论】:

    • 非常感谢......计时器问题在我身边......确实是非常愚蠢的错误,但很好学习
    • 这是正确的。我为 Stormpath 工作;我们所有的服务器都会自动同步到互联网时间。我猜本地服务器时间已经关闭了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-14
    • 2015-07-27
    • 2016-09-22
    • 2016-08-06
    • 1970-01-01
    • 2020-09-03
    • 1970-01-01
    相关资源
    最近更新 更多