# Question about token expiry

**URL:** <https://community.auth0.com/t/question-about-token-expiry/107020>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [May 16, 2023, 11:06am UTC](https://community.auth0.com/t/question-about-token-expiry/107020 "2023-05-16T11:06:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkrp1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@kkrp1](https://community.auth0.com/u/kkrp1)\
**Post date:** [May 16, 2023, 11:06am UTC](https://community.auth0.com/t/question-about-token-expiry/107020/1 "2023-05-16T11:06:20Z")

</div>

Hey everyone,

I note that the JWT returns an `exp` key in its payload, which denotes when the token expires.

My question is, do I have to implement this myself (i.e. grab this value, check it’s in the future, etc.) or does token validation fail automatically if it’s expired?

I’m currently validating the JWT via `express-oauth2-jwt-bearer`, like so:

```auto
const { auth } = require('express-oauth2-jwt-bearer');
auth({
	audience: process.env.AUTH0_API_AUDIENCE,
	issuerBaseURL: process.env.AUTH0_API_DOMAIN
});

```

Will this fail if the token has expired, or does it merely check the signing?

Thank you.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [May 26, 2023, 11:21pm UTC](https://community.auth0.com/t/question-about-token-expiry/107020/3 "2023-05-26T23:21:34Z")

</div>

Hey @kkrp1 !

> [@kkrp1](#):
>
> I note that the JWT returns an `exp` key in its payload, which denotes when the token expires.
> 
> My question is, do I have to implement this myself (i.e. grab this value, check it’s in the future, etc.) or does token validation fail automatically if it’s expired?

Token validation should fail if the token is expired according to its `exp` claim.

Cheers!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 9, 2023, 11:22pm UTC](https://community.auth0.com/t/question-about-token-expiry/107020/4 "2023-06-09T23:22:09Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
