Pcornel
Browse topics
Options
Recent
Favorites
Identity · Technical reference

Refresh Token

Direct answer

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.

When to use this

Use this when clients get new access tokens without reauthenticating.

First 30 seconds

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.

Operational verification

refresh token → token endpoint → new tokens (rotated)

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • 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.
Platform / version applicability
Identity, authentication and access control
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformIdentity, authentication and access control
Scope / prerequisiteUse this when clients get new access tokens without reauthenticating.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • Refresh tokens are long-lived and powerful.
  • Use rotation and revocation.
  • Store securely.
Key checks
  • 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:

MeasureEffect
Refresh token rotationEach use returns a new refresh token; reuse of an old one revokes the family
Sender constraintBound to the client (DPoP, mTLS)
Secure storageServer-side or OS secure storage; not in browser localStorage
Revocation on eventsPassword change, logout, device loss
Lifetime limitsAbsolute 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Lifecycle and ownership

  • Issued with offline_access scope (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_grant by sending the user to log in again.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docIdentity, authentication and access control current

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%
Terminology layer

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.

Aliases that resolve here
refresh tokenrefresh token rotation
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

ResponseMeaning
New access_token and new refresh_tokenRotation active — the client must store the new refresh token
New access_token, no refresh_tokenNo rotation; keep using the old refresh token
invalid_grantRefresh token expired, revoked, already used (rotation), or the user/session was invalidated — user must log in again
invalid_clientClient authentication failed (secret expired) — not a user problem
invalid_scopeRequested more scope than originally granted
Confirmation

Confirm action

Continue?