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

Move nbf and exp verifications after signature verification. #53

Merged
merged 2 commits into from
Nov 20, 2016
Merged

Move nbf and exp verifications after signature verification. #53

merged 2 commits into from
Nov 20, 2016

Conversation

alexjab
Copy link
Collaborator

@alexjab alexjab commented Nov 12, 2016

Hi,

I would like to move the signature validation before the check of exp and nbf claims.

I have the following scenario, which I believe is quite common: I sign tokens with an expiration date, but I want my system to be able to refresh them (i.e. re-emit a new one with the data of the old one, but with a later expiration date) if the expiration date was near AND the token passed validation. Currently I can't, because an expiration error will be thrown before the actual validation.

To do that, we need the token to be validated first, and then its expiration checked. People that don't want to use expiration, can just opt-out and not put any exp flag, as usual. This should not change anything for the rest of the users, and allow a new interesting use case.

Please tell me if there is an issue I did not think of.

@hokaccha
Copy link
Owner

It looks good. Could you check CI is failing?

@alexjab
Copy link
Collaborator Author

alexjab commented Nov 20, 2016

Looks like it was a mismatch between the version in package.json and in the code.

@hokaccha
Copy link
Owner

LGTM

@hokaccha hokaccha merged commit c988eb2 into hokaccha:master Nov 20, 2016
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

Successfully merging this pull request may close these issues.

2 participants