Use this when clients get new access tokens without reauthenticating.
Refresh Token
A refresh token lets a client get new access tokens without the user logging in again. It is long-lived and powerful, so store it securely and use rotation and revocation.
1. Refresh tokens get new access tokens without re-login.
2. Rotate and detect reuse.
3. Bind to client (sender-constrained/DPoP where possible).
4. Revoke on logout/risk.
5. Long-lived — protect well.
refresh token → token endpoint → new tokens (rotated)
Context & applicabilityCommon mistakes · platform/version boundaries
- Storing refresh tokens in browser localStorage.
- No rotation, so a stolen token works for months.
- Not revoking tokens when users are disabled or devices are lost.
- Single-page apps given long-lived refresh tokens instead of using a backend-for-frontend pattern.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
# Exchange a refresh token (confidential client)
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" \
-d grant_type=refresh_token -d "refresh_token=$REFRESH_TOKEN" \
https://auth.example.com/oauth2/token | jq '{token_type, expires_in, scope, has_new_refresh: (.refresh_token != null), error, error_description}'
# Revoke a refresh token (RFC 7009)
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" -d "token=$REFRESH_TOKEN" -d token_type_hint=refresh_token https://auth.example.com/oauth2/revoke -o /dev/null -w '%{http_code}\n'
Run these only against test accounts; a refresh with rotation invalidates the token you used.
Step 2 Failure boundaries Narrow the fault
- Client storage: token lost or overwritten, or the old token reused after rotation (two app instances racing).
- IdP policy: lifetime or inactivity limits, Conditional Access requiring re-authentication, user disabled or password reset.
- Security events: reuse detection revokes the whole token family.
- Client credentials: expired client secret makes every refresh fail with
invalid_client.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Refresh tokens are long-lived and powerful.
- Use rotation and revocation.
- Store securely.
- Refresh token rotation setting — enabled
- Revocation endpoint — working
- Storage of refresh tokens — protected
ReferenceWhat it is1 section · depth on demand
Direct Answer
A refresh token lets a client obtain new access tokens without a new login. It is long-lived and powerful: store it server-side or in secure OS storage, use rotation (each use returns a new one), and expect invalid_grant when it has expired, been revoked or reused — then send the user back to log in.
ReferenceWhy it matters1 section · depth on demand
Protecting refresh tokens
- Store them server-side or in secure OS storage; never in browser localStorage for SPAs (use the BFF pattern or rotation).
- Enable refresh token rotation: each use returns a new token and detects reuse of old ones.
- Revoke on logout, password reset and suspicious activity.
- Limit lifetime and bind them to the client.
A stolen refresh token gives long-term access without the user's password or MFA.
ReferenceImportant terms & boundaries2 sections · depth on demand
Rotation and revocation
With refresh token rotation, each use returns a new refresh token and invalidates the old one; reuse of an old token signals theft and should revoke the whole family. Revoke refresh tokens on password change, account disable and logout. In Entra ID, Revoke-MgUserSignInSession invalidates refresh tokens for a user.
In depth
A refresh token lets a client obtain new access tokens without the user logging in again. It is long-lived and powerful, so it needs stronger protection than access tokens.
Protections:
| Measure | Effect |
|---|---|
| Refresh token rotation | Each use returns a new refresh token; reuse of an old one revokes the family |
| Sender constraint | Bound to the client (DPoP, mTLS) |
| Secure storage | Server-side or OS secure storage; not in browser localStorage |
| Revocation on events | Password change, logout, device loss |
| Lifetime limits | Absolute and idle expiry |
Stolen refresh tokens are a common way attackers keep access after an MFA-protected login — revoke sessions as part of incident response.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle and ownership
- Issued with
offline_accessscope (OIDC) or by policy; stored by the client server-side or in OS secure storage. - Used at the token endpoint with
grant_type=refresh_token; with rotation each use returns a new refresh token and invalidates the old one. - Revoked on password reset, account disable, admin revocation (RFC 7009 revocation endpoint or IdP portal), detected reuse, or inactivity/maximum lifetime.
- Ownership: the IdP sets lifetimes and rotation policy; the client must store tokens securely and handle
invalid_grantby sending the user to log in again.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → Refresh Token. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
| Response | Meaning |
|---|---|
New access_token and new refresh_token | Rotation active — the client must store the new refresh token |
New access_token, no refresh_token | No rotation; keep using the old refresh token |
invalid_grant | Refresh token expired, revoked, already used (rotation), or the user/session was invalidated — user must log in again |
invalid_client | Client authentication failed (secret expired) — not a user problem |
invalid_scope | Requested more scope than originally granted |