# If SPA's don't use refresh tokens, why is there a setting for them?

**URL:** <https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874>\
**Category:** Get Help\
**Created:** [July 24, 2020, 9:47pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874 "2020-07-24T21:47:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dedicatedmanagers](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dedicatedmanagers/32/17619_2.png) [@dedicatedmanagers](https://community.auth0.com/u/dedicatedmanagers)\
**Post date:** [July 24, 2020, 9:47pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874/1 "2020-07-24T21:47:54Z")

</div>

According to [this](http://community.auth0.com/t/how-does-auth0-spa-js-store-tokens/30284) community discussion, SPA’s don’t use refresh tokens.

So why does my SPA application have a setting for “Refresh Token Lifetime (Absolute)” in the Auth0 application settings?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/1/b1dd9084e6253a5c9d22c585f67a1519038663d9.png)

---

<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:** [July 27, 2020, 7:59pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874/3 "2020-07-27T19:59:53Z")

</div>

Hi @dedicatedmanagers,

SPAs didn’t use refresh tokens at the time of that thread…_but they can now_. With the release of [rotating refresh tokens](https://auth0.com/docs/tokens/concepts/refresh-token-rotation) SPAs are able to work with a refresh token, although a different type of refresh token than the non-rotating, non-expiring refresh tokens of old.

It looks like I actually updated that post with an edit mentioning it a while back. I will make sure it is clearer in the thread.

Let me know if you need any more clarificaiton on the subject.

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![dedicatedmanagers](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dedicatedmanagers/32/17619_2.png) [@dedicatedmanagers](https://community.auth0.com/u/dedicatedmanagers)\
**Post date:** [July 28, 2020, 8:28pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874/4 "2020-07-28T20:28:05Z")

</div>

Thanks.

Does the auth0-spa-js use rotating refresh tokens?

If so, where does it store the refresh token?

Specifically, where does it store the refresh token if `cacheLocation` is set to `localstorage` within `createAuth0Client`

---

<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:** [July 28, 2020, 9:11pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874/5 "2020-07-28T21:11:35Z")

</div>

@dedicatedmanagers,

Using refresh tokens is an option. Storing tokens in LS is also an option.

If cacheLocation is set to LS then refresh tokens will be stored in LS.

This is all outlined in the doc:

> **[Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk)**
>
> Auth0 SDK for single page applications using Authorization Code Grant Flow with PKCE.

---

<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:** [August 12, 2020, 9:11pm UTC](https://community.auth0.com/t/if-spas-dont-use-refresh-tokens-why-is-there-a-setting-for-them/46874/6 "2020-08-12T21:11:38Z")

</div>

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