Securityrefresh token rotationoffline token

Refresh token

Definition

A refresh token is issued alongside an access token and presented to the token endpoint with grant_type=refresh_token to obtain a fresh access token without user interaction.

In practice

Splitting credentials lets access tokens stay short-lived and locally verifiable while the session lasts days. Because the authorization server checks refresh tokens against its own state, revocation (logout, a disabled user, removed roles) takes effect at the next refresh. APIs keep working while the authorization server is briefly down, until access tokens expire.

Refresh tokens are high-value targets. With rotation, each use returns a new refresh token; if an old one is presented again, the server assumes theft and revokes the whole family. RFC 9700 requires rotation or sender-constraining for public clients. Store them server-side or in secure OS storage, not where page scripts can read them.

Example

A SPA's backend holds a refresh token valid for 14 days; every 10 minutes it exchanges it for a new access token and a new refresh token, and a replayed old token revokes the session.