Skip to content
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

[docs] Clarify change in date-formats #725

Merged
merged 1 commit into from
Apr 27, 2021
Merged

[docs] Clarify change in date-formats #725

merged 1 commit into from
Apr 27, 2021

Conversation

jaylinski
Copy link
Contributor

I recently upgraded a project to lcobucci/jwt:4.1. My issue was that tokens generated by v4 were rejected by the v3 version of this library, because the iat-claim validation always failed.

I could solve this issue by using the method described in this PR.

I'm not sure what caused this issue, but I guess it was leeway-related.

Related to #710

@lcobucci lcobucci self-assigned this Apr 27, 2021
@lcobucci lcobucci added this to the 4.2.0 milestone Apr 27, 2021
Copy link
Owner

@lcobucci lcobucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a teeny tiny thing.

Thanks for your contribution @jaylinski!

@@ -131,7 +131,7 @@ There are 4 main differences on the new API:

1. Token configuration methods were renamed
1. Signature is created via `Builder#getToken()` (instead of `Builder#sign()`)
1. `DateTimeImmutable` objects are now for the registered claims with dates
1. `DateTimeImmutable` objects are now used for the registered claims with dates and will use microtime instead of unix timestamps
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the explicitness here, just think that we can improve the construction. What do you think about this:

Suggested change
1. `DateTimeImmutable` objects are now used for the registered claims with dates and will use microtime instead of unix timestamps
1. `DateTimeImmutable` objects are now used for the registered claims with dates, which are by default encoded as floats with microseconds as precision

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is much better. 👍 I pushed the changes.

@lcobucci lcobucci merged commit ac5d0b2 into lcobucci:4.2.x Apr 27, 2021
@jaylinski jaylinski deleted the patch-1 branch April 27, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants