Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Token can't be used before xxxxx #467

Closed
saiyujs opened this issue Dec 28, 2020 · 3 comments
Closed

The Token can't be used before xxxxx #467

saiyujs opened this issue Dec 28, 2020 · 3 comments

Comments

@saiyujs
Copy link

saiyujs commented Dec 28, 2020

hi

this is the token : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJpc3N1ZXIiLCJleHAiOjE2MDkxNDA3MTQsImlhdCI6MTYwOTEzNzExNCwidXNlcm5hbWUiOiJhZG1pbiJ9.UBaAyr3AC0FDaiYY5dtgN_TbYin0s37iILSua9AELkU

error: com.auth0.jwt.exceptions.InvalidClaimException: The Token can't be used before Mon Dec 28 14:31:54 CST 2020.

token debug: {
"iss": "issuer",
"exp": 1609140714,
"iat": 1609137114,
"username": "admin"
}

expire time is 2020-12-28 15:31:54, why it say token can't be used before Mon Dec 28 14:31:54 CST 2020 ??? it looks use the iat?

version:
com.auth0
java-jwt
3.10.3

@saiyujs saiyujs added the feature request A feature has been asked for or suggested by the community label Dec 28, 2020
@lbalmaceda lbalmaceda removed the feature request A feature has been asked for or suggested by the community label Dec 28, 2020
@lbalmaceda
Copy link
Contributor

Yes, the "issue at" (iat) claim is checked when you verify a token. See https://github.com/auth0/java-jwt#time-validation. If you need to disable that specific check, you can do so using the following method.

@amjadali-dev
Copy link

You can also use the inbuild method ignoreIssuedAT().
Java example
JWTVerifier jwtVerifier = JWT.require(algorithm).ignoreIssuedAt().build();

@vergenzt
Copy link

vergenzt commented Dec 4, 2023

FYI I've submitted an errata request to RFC 7519 to update the spec to explicitly prohibit rejecting tokens with iat from "the future".

Feel free to follow along here: Discussion: JWT tokens containing iat values in the future should not be rejected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants