auth0 / java-jwt

Java implementation of JSON Web Token (JWT)
MIT License
5.84k stars 921 forks source link

Invalid Token: The token can't be used before 2024-04-29T04:27:39Z #686

Closed chandakakshat closed 4 months ago

chandakakshat commented 4 months ago

Checklist

Description

I've used HMAC256 algorithm to create a JWT token and verifying it with the library's verifier

JWTVerifier verifier = JWT.require(algorithm).withIssuer(issuer).build()
verifier.verify()

I've used below line to set the issue time .withIssueAt(new Date(System.currentTimeMillis())) I am getting invalid token error The token can't be used before 2024-04-29T04:27:39Z but the issue time is past the current time. I've checked the versions of jwt-java for both services which are generating and verifying the token they are same, and no timezone difference appears.

Any specific explanation for this ?

Reproduction

NA

Additional context

No response

java-jwt version

4.4.0

Java version

21