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.
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.
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.
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.