What is a Refresh Token?
A refresh token is a long-lived credential issued during an OAuth authentication flow that a client uses to obtain a new short-lived access token without requiring the user to log in again.
OAuth access tokens are deliberately short-lived (often minutes to a couple of hours) to limit the damage if one is ever leaked. But requiring a user to re-authenticate every time an access token expires would make an application unusable, so the OAuth flow also issues a refresh token, which is stored more securely and used behind the scenes to silently mint a fresh access token when the old one expires. The refresh token itself is long-lived, sometimes indefinitely, until it's revoked.
Because refresh tokens grant ongoing access, they're one of the highest-value secrets in a system and require careful handling: encryption at rest, rotation on use (issuing a new refresh token each time the old one is redeemed, invalidating the previous one), and revocation paths when a user disconnects an integration or an account is compromised. A leaked refresh token is effectively a leaked long-term login.
Refresh tokens are the mechanism that lets a background job — a scheduled sync, an automated agent — keep acting on a user's behalf hours or days after the user last opened the app, without storing their password.
In practice with Neotask
When a user connects their Google account to Neotask, the OAuth callback saves an encrypted refresh token that the worker uses to silently mint fresh access tokens before every sandbox sync — so a scheduled agent run can access the user's calendar the next morning without asking them to sign in again.
Related terms
- rest-api
- rate-limiting
- remote-mcp-server
- reverse-etl
- risk-assessment-automation
Plans
Free
$0/mo
Download without a card and start for free.
Individual
$50/mo
The full personal agent platform for one person.
Business
$100/mo
One company workspace with room to add your team.
Enterprise
$200/mo
Multiple workspaces and capacity for larger teams.
Continue