# Current Recommendation for SPA

**URL:** <https://community.auth0.com/t/current-recommendation-for-spa/42788>\
**Category:** Get Help\
**Created:** [May 11, 2020, 10:33pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788 "2020-05-11T22:33:19Z")\
**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:** [May 11, 2020, 10:33pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788/1 "2020-05-11T22:33:19Z")

</div>

What is the most current Auth0 recommendation for a Javascript based Single Page Application (SPA)?

I see [an article](https://auth0.com/docs/tokens/concepts/refresh-tokens) on Auth0’s site that states SPA’s should use Refresh Token Rotation:

> Auth0 recommends using [Refresh Token Rotation](https://auth0.com/docs/tokens/concepts/refresh-token-rotation) which provides a secure method for using Refresh Tokens in SPAs while providing end-users with seamless access to resources without the disruption in UX caused by browser privacy technology like ITP.

Just below that excript it says:

> Auth0’s former guidance was to use the [Authorization Code Flow with Proof Key for Code Exchange (PKCE)](https://auth0.com/docs/flows/concepts/auth-code-pkce) in conjuntion with [Silent Authentication](https://auth0.com/docs/api-auth/tutorials/silent-authentication) in SPAs. This is more secure solution than the Implicit Flow but not as secure as Refresh Token Rotation.

The [Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-spa-js), seems to be the most recent SDK and has a switch to use [rotating Refresh Tokens](https://auth0.com/docs/libraries/auth0-spa-js#use-rotating-refresh-tokens).

But the [Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-spa-js) also uses Authorization Code Flow with Proof Key for Code Exchange (PKCE), which is “former guidance”, per above.

> The Auth0 SPA SDK handles grant and protocol details, token expiration and renewal, as well as token storage and cacheing. Under the hood, it implements [Universal Login](https://auth0.com/docs/universal-login) and the [Authorization Code Grant Flow with PKCE](https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce).

Can someone help clarify this discrepancy? (or what I’m misunderstanding)

---

<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:** [May 11, 2020, 10:56pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788/3 "2020-05-11T22:56:55Z")

</div>

Hi @dedicatedmanagers,

Sorry for the confusion here. I agree there is some wording there that is ambiguous.

Let’s clear this up:

> Former guidance was to use the Authorization Code Flow with Proof Key for Code Exchange (PKCE) in conjunction **with Silent Authentication** in SPAs

The former/current guidance has to do with **Silent Authentication** VS **Refresh Token Rotation (RTR)**. The Auth Code + PKCE flow is used to request tokens in either instance, so that should not be the focus of that sentence.

RTR is the current guidace.

I added a PR that should clarify that doc.

---

<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:** [May 11, 2020, 10:58pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788/4 "2020-05-11T22:58:14Z")

</div>

Thanks for the info!

---

<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:** [May 11, 2020, 11:00pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788/5 "2020-05-11T23:00:24Z")

</div>

No problem! Glad to help.

---

<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:** [May 26, 2020, 11:00pm UTC](https://community.auth0.com/t/current-recommendation-for-spa/42788/6 "2020-05-26T23:00:28Z")

</div>

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