# Access token from /oauth/token becomes invalid

**URL:** <https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686>\
**Category:** Get Help\
**Created:** [June 7, 2022, 3:36am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686 "2022-06-07T03:36:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 7, 2022, 3:36am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/1 "2022-06-07T03:36:13Z")

</div>

Access token from /oauth/token becomes invalid when trying to reuse it for /userinfo even without revoking it

---

<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:** [June 8, 2022, 12:47am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/2 "2022-06-08T00:47:16Z")

</div>

Hey there @dev40!

Access Tokens for `/userinfo` do typically have a lifetime of 24 hours as outlined [here](https://auth0.com/docs/secure/tokens/access-tokens#-userinfo-endpoint-token-lifetime) - Perhaps they are expiring?

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 8, 2022, 2:25am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/4 "2022-06-08T02:25:19Z")

</div>

Hi @ty.frith thanks, even without the 24-hour lifetime, the access token we get from /oauth/token cant be reused. It seems like it becomes invalid when the user closes the browser and ends the session. We are trying to refresh the connection using the access token or refresh token from the last login without trying to ask the user to re-login. we are looking, what correct token to use?

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 10, 2022, 12:46am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/5 "2022-06-10T00:46:12Z")

</div>

@ty.frith any updates for this concern? One of our scenario is generating a token via API in our local using IIS express and VS, when we stop the session and start another one the token becomes invalid.

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 14, 2022, 2:51am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/6 "2022-06-14T02:51:27Z")

</div>

@ty.frith any updates for this concern?

---

<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:** [June 14, 2022, 8:23pm UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/7 "2022-06-14T20:23:13Z")

</div>

Hi there @dev40 sorry for the delayed response!

> [@dev40](#):
>
> when we stop the session and start another one the token becomes invalid.

I’m not really sure what could be going on here as the access token is self contained and is valid until it is not (expired).

> [@dev40](#):
>
> We are trying to refresh the connection using the access token or refresh token from the last login without trying to ask the user to re-login. we are looking, what correct token to use?

It depends on your environment and/or Auth0 SDK you are using - Most implementations rely on silent authentication wherein the SDK/code checks for an Auth0 session, and if there is one access/ID tokens are returned without ever prompting the user to login. Some more on silent authentication and SSO in an OIDC context below:

> **[Single Sign-On with OIDC](https://auth0.com/docs/authenticate/login/oidc-conformant-authentication/oidc-adoption-sso)**
>
> Learn how the OIDC-conformant pipeline affects your use of Single Sign-On (SSO).

> **[Configure Silent Authentication](https://auth0.com/docs/authenticate/login/configure-silent-authentication)**
>
> Learn how to keep users logged in to your application using silent authentication.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 16, 2022, 7:00am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/8 "2022-06-16T07:00:36Z")

</div>

@ty.frith what is the best way to handle if the token from Authorization Code became invalid?

---

<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:** [June 16, 2022, 6:05pm UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/9 "2022-06-16T18:05:46Z")

</div>

Are you able to elaborate on this a bit? Are you referring to a similar scenario as above where the access and/or ID token received during an Authorization Code flow is invalid? Or the authorization code itself being invalid?

If you can share a specific error and or perhaps even screenshots that could be helpful!

---

<div class="post-metadata">

**Author:** ![dev40](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dev40/32/33281_2.png) [@dev40](https://community.auth0.com/u/dev40)\
**Post date:** [June 17, 2022, 8:57am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/12 "2022-06-17T08:57:14Z")

</div>

@ty.frith I already saw the issue and it’s about SSL/TLS secure channel. I just added something for this

---

<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:** [July 2, 2022, 8:57am UTC](https://community.auth0.com/t/access-token-from-oauth-token-becomes-invalid/84686/13 "2022-07-02T08:57:34Z")

</div>

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