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

Changed string return type to float according to JWT specs #637

Closed
wants to merge 1 commit into from
Closed

Changed string return type to float according to JWT specs #637

wants to merge 1 commit into from

Conversation

enrico-atzeni
Copy link

NumericDate of exp and iat claims do not respect JWT specifications as of here
exp: https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.4
iat: https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.6

both says

[...] Its value MUST be a number containing a NumericDate value. [...]

but MicrosecondBasedDateConversion's convertDate method returns a string instead of a number.

return $seconds . '.' . $microseconds;

Fixed it casting the string to a float:

return (float) ($seconds . '.' . $microseconds);

@Slamdunk
Copy link
Collaborator

Duplicate of #618
See also #617 #623

@enrico-atzeni
Copy link
Author

thanks @Slamdunk, didn't find it before, I will use the fix mentioned in #618

@lcobucci
Copy link
Owner

Hello folks, thanks to @yassinrais we managed to fix this compatibility issue whilst still preserving the microseconds precision. We already released new versions to solve the problem.

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.

None yet

3 participants