-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Java8 Date/Time formats #235
Comments
Unfortunately you cannot currently specify the ObjectMapper that the JwtBuilder will use to generate the resulting JSON. Yet. :) We'll use this issue to track the work to allow you to do so :) That said, would you say this issue should be classified as "Allow me to set my own ObjectMapper" ? Or is the issue really "Please support Java8 Date/Time formats ? Thoughts? Thanks for the issue! |
Hi Les, |
It would be nice to have overloaded methods e.g. in
Would you accept a PR for that? |
Depends on #308. |
This ticket would add support for claims of type:
Anything else? |
Can we add |
I would not support Even the JSR-310 expert group leader thinks |
@marschall I completely agree. |
@RockyMM sure, |
Hi, it's 2023, any good news? |
Once #279 is in, Java8 support is next! |
What's the status of this issue? |
@bartsopers Not yet implemented, but it will be, likely after the holidays. All of our energy was focused on 0.12.0, so now that it's out, we will focus on other 1.0 issues (like this one) soon. |
…T claims This commit replaces the usage of java.util.Date with java.time.Instant in handling JWT claims. This means upgrading from JDK7 to JDK8. This is done for better adherence to ISO 8601 standards and better precision in time-related operations. Classes working with claims have been updated to use the newer Instant class, providing better precision and cross-timezone compatibility. Additionally, overloading convenience methods for setting OffsetDateTime and ZonedDateTime on top of Instant have been added on the JwtBuilder and DefaultJwtBuilder.
The JWT handling has been updated to default to Java's Instant class. This change removed support for various date and time classes such as ZonedDateTime, OffsetDateTime, Date, and Calendar in favor of an Instant-based approach throughout the codebase. The appropriate tests and documentation were updated to reflect this change.
Replaced all instances of 'Date' with 'Instant' in JwtParserTest to more accurately reflect variable usage. Also added a TODO in JwtDateConverter.java to clarify the handling of epochMillis vs epochSeconds.
This commit updates the version of the project across all pom.xml files from 0.12.4-SNAPSHOT to 1.0.0-SNAPSHOT as it prepares for a major release. Changes cover the core project and various extensions, signaling a coordinated upgrade across the codebase.
All instances of java.util.Date in code have been replaced with java.time.Instant for better time precision and timezone handling. This includes changes in variable names, method names, test cases, comments and documentation. The java.util.Date-based utilities have also been removed.
Hi,
Maybe I'm missing something so apologies if this is not an issue.
I've configured my spring boot application to use jackson-datatype-jsr310 by including in pom.xml, all outgoing json is serialized correctly.
however I am using a hashmap to set the payload of the the jwt token:
and this is being serialized in the Long LocalDateTimeFormat:
I had a similar issue in another spring boot application where I was using new ObjectMapper() and not using springBoots configured ObjectMapper.
Any ideas how I could make jjwt pick up springboots ObjectMapper which would be configured correctly ?
I'm using using jjwt version 0.7.0.
Thanks in advance for your help,
Peter
The text was updated successfully, but these errors were encountered: