auth0 / java-jwt

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

[SDK-3171] Fix header claims serialization #549

Closed jimmyjames closed 2 years ago

jimmyjames commented 2 years ago

Changes

Currently, we serialize the header claims using Jackson's default writeString. This causes date-time based claims to be serialized as milliseconds since the epoch, instead of the required seconds since the epoch.

This PR refactors much of the logic of the PayloadSerializer out to a new class ClaimsSerializer, which allows a subclass to override how the claim is written (needed to handle the aud claim serialization for the payload).