By default, java-jwt validates standard DateTime claims: iat (issued at) must be in the past, exp (expiration) must be in the future, and nbf (not before) must be in the past. If validation fails, a JWTVerificationException is thrown.
You can use acceptLeeway(int seconds) to allow a grace period for all DateTime claims. You can also override the leeway for specific claims using acceptExpiresAt(int seconds).
// Apply 1 second leeway to nbf, iat, and exp
JWTVerifier verifier = JWT.require(algorithm)
.acceptLeeway(1)
.build();
// Apply 1 second leeway to nbf and iat, but 5 seconds specifically for exp
JWTVerifier verifier = JWT.require(algorithm)
.acceptLeeway(1)
.acceptExpiresAt(5)
.build();