-
After upgrading from lcobucci/jwt v3 to v4 the service I'm sending a JWT to is now saying it's invalid. Before, v3:
After, v4:
So it seems that timestamps (NumericDate in RFC7519) are now floats, encoded as string instead of integers. I assume this is not a bug but intentional, but can I please have some advice on how to handle this when my service provider doesn't seems to like the new format? This is a snippet of the code I'm using (as taken from the example on the website):
Should I not use expiresAt() and issuedAt() methods and set the iat and exp claims 'manually'? Happy new year! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi, as discussed in #618 a dedicated PR is already on the way to provide integer only dates: #617 |
Beta Was this translation helpful? Give feedback.
-
On Tue, 5 Jan 2021 at 17:44, Luís Cobucci ***@***.***> wrote:
We don't have an ETA, there're a few things that we want to handle before
releasing it.
You can follow the docs and create that component on your code and remove
once v4.1 gets released:
https://lcobucci-jwt.readthedocs.io/en/stable/extending-the-library/#claims-formatter
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#623 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHY3RGSHF3NGUQ3ZF5ERKLSYM6YDANCNFSM4VVB2J4A>
.
Thank you for the advice, Luís.
|
Beta Was this translation helpful? Give feedback.
-
This is now possible with v4.1 being release as of 2021-01-28. I fixed it by using the new claims formatter in the builder, like this:
|
Beta Was this translation helpful? Give feedback.
-
Just a small update here: encoding the time fractions as strings cause compatibility issues with other libraries. |
Beta Was this translation helpful? Give feedback.
Hi, as discussed in #618 a dedicated PR is already on the way to provide integer only dates: #617