- Authorization Code Flow
- Authorization Code Flow with Proof Key for Code Exchange
- Device Authorization Flow
- Resource Owner Password Flow
Maintain user sessions in SPAs
Until very recently, SPAs maintained the user’s session by using the Authorization Code Flow with PKCE in conjunction with silent authentication. Recent developments in browser privacy technology, such as Intelligent Tracking Prevention (ITP) prevent access to the Auth0 , thereby requiring users to reauthenticate.

Automatic reuse detection
When a client needs a new access token, it sends the refresh token with the request to Auth0 to get a new token pair. As soon as the new pair is issued by Auth0, the refresh token used in the request is invalidated. This safeguards your app from replay attacks resulting from compromised tokens. Without enforcing sender-constraint, it’s impossible for the to know which actor is legitimate or malicious in the event of a replay attack. So it’s important that the most recently issued refresh token is also immediately invalidated when a previously-used refresh token (already invalidated) is sent to the authorization server. This prevents any refresh tokens in the same token family (all refresh tokens descending from the original refresh token issued for the client) from being used to get new access tokens. For example, consider the following scenario:
- Legitimate Client has refresh token 1, and it is leaked to or stolen by Malicious Client.
- Legitimate Client uses refresh token 1 to get a new refresh token/access token pair.
- Auth0 returns refresh token 2/access token 2.
- Malicious Client then attempts to use refresh token 1 to get an access token. Auth0 recognizes that refresh token 1 is being reused, and immediately invalidates the refresh token family, including refresh token 2.
- Auth0 returns an access denied response to Malicious Client.
- Access token 2 expires and Legitimate Client attempts to use refresh token 2 to request a new token pair. Auth0 returns an access denied response to Legitimate Client.
- Re-authentication is required.
ferrt
indicating a failed exchange) in logs. This can be especially useful in conjunction with Auth0’s log streaming capabilities to detect suspicious activity.
Another example is where the malicious client steals refresh token 1 and successfully uses it to acquire an access token before the legitimate client attempts to use refresh token 1. In this case, the malicious client’s access would be short-lived because refresh token 2 (or any subsequently issued refresh tokens) is automatically revoked when the legitimate client tries to use refresh token 1, as shown in the following diagram:

SDK support
The following SDKs include support for refresh token rotation and automatic reuse detection.- Auth0 SPA SDK
- Flutter (Web)
- Swift (iOS) SDK
- Android SDK
- Flutter
- React Native SDK
- WPF / Winforms
- Xamarin