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

v3.4.2 Possible incorrect implementation of 4.1.4 from RFC 7519 #633

Closed
anikeevda opened this issue Jan 20, 2021 · 2 comments
Closed

v3.4.2 Possible incorrect implementation of 4.1.4 from RFC 7519 #633

anikeevda opened this issue Jan 20, 2021 · 2 comments
Assignees
Labels
Milestone

Comments

@anikeevda
Copy link

anikeevda commented Jan 20, 2021

According to RFC, The processing of the "exp" claim requires that the current date/time MUST be before the expiration date/time listed in the "exp" claim.. So current_time < exp translates into valid token and current_time >= exp into invalid token . In Factory constructor exp validation made with 'exp' => [$this, 'createGreaterOrEqualsTo'] which seems to be correct while In Token class method isExpired implemented as

$now = $now ?: new DateTimeImmutable();
return $now > $this->claims->get(RegisteredClaims::EXPIRATION_TIME);

Does this is correct solution and maybe comparison shoud be made as ?

$now = $now ?: new DateTimeImmutable();
return $now >= $this->claims->get(RegisteredClaims::EXPIRATION_TIME);
@vitovtnet
Copy link

Agree with @anikeevda - we have a lot of problems with these validations.

@lcobucci
Copy link
Owner

@lcobucci lcobucci self-assigned this Jan 27, 2021
@lcobucci lcobucci added the Bug label Jan 27, 2021
@lcobucci lcobucci added this to the 3.4.3 milestone Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants