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

Disallowing Validation of Expired Tokens #959

Open
andreseloysv opened this issue Feb 5, 2024 · 0 comments
Open

Disallowing Validation of Expired Tokens #959

andreseloysv opened this issue Feb 5, 2024 · 0 comments

Comments

@andreseloysv
Copy link

The Problem

The library first validates the signature of tokens before assessing their expiration status. This approach results in unnecessary CPU usage, as it not only validates signatures of expired tokens but also decodes them again using the verify method of node-jws. This double processing of expired but correctly signed tokens is inefficient and could be optimized.

The ideal solution

I would like the jsonwebtoken library to first verify if a token has expired before it checks the signature. This approach would improve efficiency and security by immediately discarding tokens that are no longer valid due to expiration.

Alternative

currently, one might manually check the expiration of the token before passing it to the library, but this adds extra steps and complexity to the authentication process.

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

1 participant