.jpg)
Token lifecycle
Learn why refresh tokens exist, how the rotation pattern works, and what to watch for when tokens stop working.
Access tokens are intentionally short-lived (often 5–60 minutes) to limit damage if they leak. But re-authenticating users every hour is not practical. Refresh tokens let your backend obtain a fresh access token behind the scenes so automations keep running.
POST /oauth/token Content-Type: application/x-www-form-urlencoded grant_type=refresh_token& client_id=YOUR_CLIENT_ID& client_secret=YOUR_CLIENT_SECRET& refresh_token=REFRESH_TOKEN
Providers such as Google, Slack, and Auth0 often issue a new refresh token every time the old one is used. Adopt rotation whenever it is supported.
An invalid_grant response usually means the refresh token is no longer valid. Here are the most common causes:
When a refresh token fails, prompt the user to re-authorize. Avoid silent loops that hammer the provider with repeated refresh attempts.