Skip to content

[docs] Clarify change in date-formats#725

Merged
lcobucci merged 1 commit intolcobucci:4.2.xfrom
jaylinski:patch-1
Apr 27, 2021
Merged

[docs] Clarify change in date-formats#725
lcobucci merged 1 commit intolcobucci:4.2.xfrom
jaylinski:patch-1

Conversation

@jaylinski
Copy link
Copy Markdown
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
Copy Markdown
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!

Comment thread docs/upgrading.md Outdated
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
Copy Markdown
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
Copy Markdown
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