# Refreshing id\_token with express-openid-connect

**URL:** <https://community.auth0.com/t/refreshing-id-token-with-express-openid-connect/73348>\
**Category:** Get Help\
**Tags:** express, openidconnect\
**Created:** [November 17, 2021, 9:17pm UTC](https://community.auth0.com/t/refreshing-id-token-with-express-openid-connect/73348 "2021-11-17T21:17:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel12](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/daniel12/32/12778_2.png) [@daniel12](https://community.auth0.com/u/daniel12)\
**Post date:** [November 17, 2021, 9:17pm UTC](https://community.auth0.com/t/refreshing-id-token-with-express-openid-connect/73348/1 "2021-11-17T21:17:56Z")

</div>

I followed the basic example here to set up authentication for my app: [GitHub - auth0/express-openid-connect: An Express.js middleware to protect OpenID Connect web applications.](https://github.com/auth0/express-openid-connect). By default it uses the implicit flow, which returns an id\_token stored in an encrypted cookie. This id\_token is used for authenticating subsequent requests to endpoints using the requiresAuth middleware.

My question are 1) isn’t it standard to use the access token for auth instead of the id token? and 2) how can you refresh the id\_token with this flow? It seems like you need refresh token, which isn’t provided in this flow.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [November 26, 2021, 5:45pm UTC](https://community.auth0.com/t/refreshing-id-token-with-express-openid-connect/73348/3 "2021-11-26T17:45:11Z")

</div>

Hi @daniel12,

Welcome to the Auth0 Community!

> [@daniel12](#):
>
> isn’t it standard to use the access token for auth instead of the id token?

The access token is typically used with requests made to resource servers. The ID token is used by the client application.

More on the difference here: [ID Token and Access Token: What Is the Difference?](https://auth0.com/blog/id-token-access-token-what-is-the-difference/)

> [@daniel12](#):
>
> how can you refresh the id\_token with this flow? It seems like you need refresh token, which isn’t provided in this flow.

This resource is helpful with examples for accessing protected routes and refresh token flows:

> <https://github.com/auth0/express-openid-connect/blob/master/EXAMPLES.md#5-obtaining-and-using-refresh-tokens>

---

<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:** [January 20, 2022, 11:06pm UTC](https://community.auth0.com/t/refreshing-id-token-with-express-openid-connect/73348/4 "2022-01-20T23:06:22Z")

</div>

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