#825·jjwt

Include auth_time in SpecDates

Author: lauridsCreated Sep 13, 2023Updated Apr 23, 2025
Labelsenhancement

Is your feature request related to a problem? Please describe. "auth_time" is not part of the default fields in Claims. When we need to read it, we cannot use claims.get("auth_time", Date.class) because the parameter is in seconds and java.util.Date requires milliseconds.

Describe the solution you'd like Ideally all the Authentication Information Claims (auth_time, acr, amr) added as getters in Claims, or just auth_time added in DefaultClaims.isSpecDate, to be able to do e.g. claims.get("auth_time", Date.class).

Describe alternatives you've considered Instead of reading it as a Date directly, we need to do something like: var authTimeSeconds = claims.get("auth_time", Long.class); var authTime = authTimeSeconds == null ? null : new Date(authTimeSeconds * 1000);

Additional context See https://datatracker.ietf.org/doc/html/rfc9068#section-2.2.1