Security teams should issue a new refresh token every time a refresh request succeeds, and immediately invalidate the previous token. Store token metadata, including expiry and used status, so the service can verify freshness and reject stale tokens. Pair rotation with secure transport, signature validation, and server-side token tracking to reduce the value of stolen refresh tokens.
Rotation in Stateless Authentication Depends on Server-Side State
refresh token rotation only works reliably in a stateless authentication design if the service adds a small amount of server-side state for refresh token, even when access tokens remain stateless. Each successful refresh should mint a new refresh token, mark the old one as used, and keep enough metadata to detect replay, expiry, and token family reuse.
That design choice matters because a purely stateless refresh flow cannot distinguish a legitimately re-used token from a stolen one. Rotation turns refresh tokens into one-time or near one-time credentials, so the backend must remember which token was last issued and whether it has already been redeemed.
Rotation is most effective when the refresh token is treated as a high-value secret with a bounded lifetime. The service should validate the token signature, enforce expiry, and store issuance metadata such as token ID, family ID, subject, client binding, and used status so the next refresh request can be checked against the last accepted state.
In practice, this approach also creates a cleaner revocation story. If a token is replayed, the service can reject the entire token family or force re-authentication, which reduces the window in which a stolen refresh token can be exchanged for new access tokens.
A useful implementation pattern is to keep access tokens stateless for scale, while maintaining a compact refresh-token record in a database or cache. The state does not need to be large, but it does need to be authoritative and fast enough to evaluate every refresh request before issuing a replacement token.
- Store a unique identifier for each refresh token and link it to a token family or session record.
- Mark the presented token as used as soon as refresh succeeds, then issue the replacement token immediately.
- Reject any second use of the same token, especially after a new token has already been issued from that family.
Controls That Make Rotation Safe in Real Deployments
Rotation should sit alongside transport protection and strict validation, not replace them. Refresh tokens still need TLS in transit, server-side signature verification, issuer and audience checks where relevant, and secure storage that prevents accidental logging or client-side persistence beyond the intended boundary.
For distributed services, the hardest part is consistency. If two refresh requests arrive close together, the service must handle race conditions deterministically so one request succeeds and the other is rejected. Without that safeguard, rotation can create false positives or allow duplicate token issuance during retries and network delays.
Most teams also need a clear policy for client binding and reuse detection. If the same refresh token appears from a different context than expected, or if a previously used token is seen again, that should be treated as a security signal rather than a routine retry.
The operational trade-off is that stronger rotation increases backend lookups and state management, but that cost is usually justified by the reduction in replay value. Rotation is not mainly about making theft impossible, it is about making theft short-lived and detectable.
Useful related reading includes Guide to NHI Rotation Challenges for lifecycle and expiry edge cases, and Ultimate Guide to NHIs, Static vs Dynamic Secrets for the long-lived versus ephemeral credential trade-off. For control alignment, see OWASP Non-Human Identity Top 10 and NIST SP 800-57 Key Management.
Risk and Threat Considerations
Rotation reduces the damage from refresh-token theft, but it does not eliminate it. The main risk is replay, if an attacker steals a refresh token and uses it before the legitimate client rotates it, the attacker can inherit the session and continue minting new access tokens until the token family is invalidated.
Failure mechanism: Weak replay detection, delayed revocation, or inconsistent state across nodes can let an old refresh token remain usable after it should have been retired.
Impact: Attackers can extend session lifetime, bypass normal reauthentication cadence, and keep access even after the original compromise should have been contained.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST SP 800-63, NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 — Secrets and Credential Management | Refresh tokens are identity-bearing secrets that must be rotated and tracked. |
| NHI-02 — Lifecycle and Expiry | The question centers on expiring old refresh tokens and issuing replacements safely. | |
| NHI-06 — Detection and Monitoring | Reuse detection and stale-token rejection are essential to spot replay abuse. | |
| Recommendation — Rotate refresh tokens on use and reject any reused token from the same family. Enforce short-lived refresh-token lifetimes and retire prior tokens immediately after redemption. Log refresh reuse events and alert on stale-token redemption or family invalidation. | ||
| NIST SP 800-63 | 6.1 — Session Management | Refresh tokens extend authenticated sessions and require careful session continuity controls. |
| Recommendation — Bind refresh handling to robust session state and invalidate the session on reuse or compromise. | ||
| NIST CSF 2.0 | PR.AA-01 — Identity Management, Authentication, and Access Control | Refresh rotation is part of controlling authenticated access and preventing unauthorized reuse. |
| Recommendation — Apply strong authentication and access controls to refresh-token issuance and redemption. | ||
| CIS Controls v8 | 6.3 — Require MFA for Externally-Exposed Applications | Refresh-token replay risk is reduced when the surrounding session has stronger authentication assurance. |
| 16.9 — Monitor and Defend Against Session Hijacking | Refresh-token replay is a session-hijacking problem that needs detection and response. | |
| Recommendation — Require stronger authentication for sensitive sessions that depend on long-lived refresh capability. Detect session reuse signals and invalidate compromised refresh-token chains promptly. | ||
Practitioner Guidance
What to verify: Confirm that rotation is enforced on every successful refresh path, not only on the happy path in one service instance. You want a single authoritative decision point for token reuse, plus deterministic handling of retries, failover, and concurrent refresh attempts.
Common mistake: Teams often rotate the token value but fail to track token family state tightly enough to spot reuse. If a stale token can still be redeemed after a newer one exists, the implementation is only cosmetically rotating.
What to measure: Track refresh reuse attempts, token family invalidations, and refresh failures caused by stale or replayed tokens. A rising reuse count is an incident signal, not just noise, because it can indicate client bugs, clock skew, or active token theft.
Practitioner takeaway: In stateless authentication, refresh token rotation is a stateful security control disguised as a session feature, so the backend record must be authoritative enough to detect replay without making refresh brittle.
Related resources from NHI Mgmt Group
- How should security teams implement authentication for public REST APIs?
- How should security teams implement JWT authentication without turning tokens into a permanent session mechanism?
- How should security teams implement Client ID Metadata Documents?
- How should security teams implement enterprise authentication in a TypeScript backend without creating brittle token plumbing?