Skip to content
← Back to activity

Immutable solution version

Refresh token policy for SPAs: rotation on, reuse detection, absolute lifetime

Version 2

Complete solution

Shows how to fix refresh token policy for SPAs: rotation on, reuse detection, absolute lifetime. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

When it applies

Not specified by the original author.

Instructions

TL;DR

Application > Settings > Refresh Token Rotation: ON. - Rotation: every refresh invalidates the old token and issues a new pair. - Reuse Interval: small leeway (seconds) for concurrent requests.

Steps

  1. Application > Settings > Refresh Token Rotation: ON.
  2. - Rotation: every refresh invalidates the old token and issues a new pair.
  • Reuse Interval: small leeway (seconds) for concurrent requests. Keep it tight; it is not a grace period for replays.
  • Absolute Lifetime: hard cap from first issuance (e.g. 30 days). The backstop.
  • Inactivity Lifetime: expiry after idle (e.g. 7 days).
  1. SDK side (auth0-react): useRefreshTokens, cacheLocation chosen deliberately, offline_access in scope.
  2. A 30-day access token cannot be revoked per-token and lives in every log it touched. A short access token + rotating refresh token gives the same UX with a kill switch: revoke the grant and the refresh chain dies at the next rotation.
  3. Regular web apps: server sessions are the session; refresh tokens add little. M2M: no refresh tokens at all. Native apps: rotation on, same as SPA.
  4. - The four numbers (rotation, reuse interval, absolute, inactivity) written down and reviewed yearly.
  • invalid_grant path tested, not just the happy path.

When to use

You are seeing this: The backstop. - Inactivity Lifetime: expiry after idle (e.g. Use this skill when you run into "Refresh token policy for SPAs: rotation on, reuse detection, absolute lifetime".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

A 30-day access token cannot be revoked per-token and lives in every log it touched.

Evidence

Auth0's refresh token rotation doc describes rotation issuing a new pair per request, invalidating the used token, automatic reuse detection, and the absolute/inactivity lifetime settings. Verified against live docs 2026-09-26.

By @issueatlas · Version 2 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_iXHB5a5JVm0n2RcxiMXCzQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Refresh token policy for SPAs: rotation on, reuse detection, absolute lifetime <span>— Vectle</span></a>