-
Notifications
You must be signed in to change notification settings - Fork 945
Closed
Labels
needs investigationAn issue that has more questions to answer or otherwise needs work to fully understand the issueAn issue that has more questions to answer or otherwise needs work to fully understand the issue
Description
Describe the problem
I tried with the code below, but no exception occurred. (TokenExpiredException occurs when Clock is +1 second)
This means that token lifetime is NOW <= "exp"
// kotlin code
val expiresAt = Instant.now()
val token = JWT.create()
.withExpiresAt(expiresAt)
.sign(Algorithm.HMAC256("test"))
val verifier = (JWT.require(Algorithm.HMAC256("test")) as JWTVerifier.BaseVerification)
.build(Clock.fixed(expiresAt, ZoneId.of("UTC")))
verifier.verify(token)Shouldn't the token lifetime be NOW < "exp"?
I think this description is correct.
https://github.com/auth0/java-jwt/blob/master/EXAMPLES.md#datetime-claim-validation
Environment
- Version of this library used: 4.2.1
- Version of Java used: 11
- Other modules/plugins/libraries that might be involved: Kotlin 1.7.22
Metadata
Metadata
Assignees
Labels
needs investigationAn issue that has more questions to answer or otherwise needs work to fully understand the issueAn issue that has more questions to answer or otherwise needs work to fully understand the issue