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

Timestamps are limited by Integer/int to 2038-01-19T04:14:07.000+0100 #132

Closed
larspettern opened this issue Jan 16, 2017 · 1 comment
Closed
Milestone

Comments

@larspettern
Copy link

larspettern commented Jan 16, 2017

If the "expires at" claim is set to a date larger than 2038-01-19, then it gets broken by the fact that the date is translated into a int. See PayloadSerializer line 58

The latest date possible to represent in seconds as a Java Integer is

new Date(Integer.MAX_VALUE * 1000L);

Which corresponds to 2038-01-19T04:14:07.000+0100

The date claims should always be respresented as Long in Java since the second values will overflow the Integer max value and you will get an erroneous value.

This applies to the other timestamp claims also (issued at, and not before) together with the custom date claims.

@lbalmaceda
Copy link
Contributor

@larspettern thanks for the report. I'll look into it 👍

@hzalaz hzalaz added this to the v3-Next milestone Feb 24, 2017
@hzalaz hzalaz closed this as completed Feb 24, 2017
@lbalmaceda lbalmaceda modified the milestones: v3-Next, 3.2.0 May 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants