IAM glossary
What is Access token?
The token an app sends to an API to act on behalf of a user or of itself. It is meant for the API (its audience), should be short-lived, and the client should not rely on its content.
How it works
After a successful OAuth flow, the authorization server gives the client an access token. The client attaches it to every API call, usually as Authorization: Bearer <token>. The API validates it (signature or introspection, issuer, audience, expiry, scopes) and then decides what to return.
An access token can be a JWT that the API checks by itself, or an opaque string that the API sends back to the authorization server to ask “is this valid?”. Either way it is a key: whoever holds it can use it until it expires, which is why it should live minutes, not days.
A simple example
A budgeting app wants to read your bank transactions. After you consent, it receives an access token with scope transactions:read valid for 10 minutes. It calls GET /transactions with the token; the bank API accepts it. If the app tried POST /payments, the API would refuse: the scope does not allow it.
Common mistakes
- Using the ID token to call an API: it is meant for the client, not for the API.
- APIs that check the signature but not the audience, so a token issued for another API is accepted.
- Long lifetimes and storage in localStorage, where any injected script can read it.