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

No examples on how to set expiry of token #92

Open
neogeno opened this issue Sep 17, 2019 · 4 comments
Open

No examples on how to set expiry of token #92

neogeno opened this issue Sep 17, 2019 · 4 comments

Comments

@neogeno
Copy link

neogeno commented Sep 17, 2019

If I set a standard claim "exp" in my JWE token with expiry date in the past it doesn't seem to make any difference. Other libraries will throw an error saying the token has expired? What is the correct usage in this library to specify token expiry?

@rohe
Copy link
Contributor

rohe commented Sep 17, 2019

I'm not sure I get the question.
Creating a JWE token with an "exp" claim that is in the past is possible to do.
The "exp" claim is only verified when the payload is verified. So it's not part of verifying a signature or doing a decryption.

@neogeno
Copy link
Author

neogeno commented Sep 17, 2019

I mean when I decrypt the token and verify the signature of such a JWE there is no error saying the token has expired. I am still able to view the payload as normal. So do you mean I have to manually check the value of the exp claim to see if the token has expired or not? Pyjwt for example will raise an error when decoding/verifying such tokens if the JWT is expired .

@aksh-gupta
Copy link

@neogeno Were you able to set exp in JWE or you implemented the expiration of token manually?

@neogeno
Copy link
Author

neogeno commented Nov 20, 2020

Had to write a seperate check

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