# How to use OKTA Vue to refresh tokens

**URL:** <https://devforum.okta.com/t/how-to-use-okta-vue-to-refresh-tokens/18817>\
**Category:** Questions\
**Created:** [January 10, 2022, 8:05am UTC](https://devforum.okta.com/t/how-to-use-okta-vue-to-refresh-tokens/18817 "2022-01-10T08:05:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnpbta](https://avatars.discourse-cdn.com/v4/letter/b/ecc23a/32.png) [@bsnpbta](https://devforum.okta.com/u/bsnpbta)\
**Post date:** [January 10, 2022, 8:05am UTC](https://devforum.okta.com/t/how-to-use-okta-vue-to-refresh-tokens/18817/1 "2022-01-10T08:05:22Z")

</div>

As we all know, the validity period of an access token is only 1 hour. How can I use the refresh token to obtain a new access token and replace the old token stored in the local storage. Does OKTA Vue have the function to support refreshing tokens

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 10, 2022, 5:29pm UTC](https://devforum.okta.com/t/how-to-use-okta-vue-to-refresh-tokens/18817/2 "2022-01-10T17:29:17Z")

</div>

You should be able to get a refresh token by adding the `offline_access` scope to your OktaAuth config and, with `autoRenew` enabled by default, you should see that a refresh token is used to fetch new access/id tokens upon their expiration.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 8, 2024, 9:14pm UTC](https://devforum.okta.com/t/how-to-use-okta-vue-to-refresh-tokens/18817/3 "2024-02-08T21:14:56Z")

</div>

Closed on February 8, 2024, 9:14pm UTC

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