Skip to content
BENIBIX Learn

Access Token vs Refresh Token

An access token is the short-lived pass you show on each request, and a refresh token is how you get a new one. The access token often lasts minutes, so a stolen one is soon useless. The refresh token lasts days or weeks. It goes only to the login server, and it must be kept far safer.

Development🔑 Auth

Access Token

A string an app sends with each request to prove it may use an API.

An access token is a string an app sends with each request to prove it may use an API. You get it after logging in, and it stands in for your password from then on. Most access tokens expire quickly, often within an hour. The server checks the token on every request before it answers. Anyone who holds a valid token can use it, so it must be kept secret.

Example
Lucy's phone app logs her in and gets an access token. For the next hour, every request carries that token instead of her password.
Why it matters
Apps never have to store or resend your password. A short-lived token limits the harm if it leaks.
Full entry
Development🔑 Auth

Refresh Token

A token that lasts a long time. It is only used to get new access tokens.

A refresh token lasts a long time and is only used to get new access tokens. Access tokens run out fast, often within an hour, so the app would keep asking you to log in. Instead, it quietly trades the refresh token for a fresh access token. Refresh tokens can last days or months. They are sent only to the login server, never to every API.

Example
Emma's access token expires at noon. Her app sends its refresh token, gets a new access token, and she never sees a login screen.
Why it matters
Users stay logged in for weeks. Each access token still runs out soon, which is safer.
Full entry

In one line

Access Token
A string an app sends with each request to prove it may use an API.
Refresh Token
A token that lasts a long time. It is only used to get new access tokens.