Use this when an application presents a token to an API to prove authorization.
Access Token
An access token is a short-lived credential an application presents to an API to prove authorization, such as an OAuth 2.0 bearer token, often a JWT with scopes and an expiry.
1. Access tokens authorise API calls.
2. Audience-restricted to the API.
3. Scopes limit actions.
4. Short-lived; refresh for longer sessions.
5. Never use ID tokens as access tokens.
client → access token → API validates aud/scope/exp
Context & applicabilityCommon mistakes · platform/version boundaries
- APIs accepting tokens issued for other APIs (missing
audcheck). - Ignoring scopes/roles, so any valid token gets full access.
- Long-lived access tokens that cannot be revoked.
- Logging full tokens in reverse proxies or application logs.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
# Call the API with the token and look at the status and WWW-Authenticate header
curl -s -o /dev/null -D - -H "Authorization: Bearer $ACCESS_TOKEN" https://api.example.com/v1/orders | grep -iE '^HTTP|www-authenticate'
# Opaque token: ask the authorization server (introspection, RFC 7662; client authentication required)
curl -s -u "$CLIENT_ID:$CLIENT_SECRET" -d "token=$ACCESS_TOKEN" https://auth.example.com/oauth2/introspect | jq '{active, scope, aud, exp, sub}'
For JWT access tokens, decode the payload (see Tokens) and compare aud, scp/roles and exp with what the API expects.
Step 2 Failure boundaries Narrow the fault
- Authorization server: token never issued or wrong scopes (consent, role assignment, client configuration).
- Client: wrong scope requested, token for another audience, token not refreshed.
- Network/proxy:
Authorizationheader stripped by a proxy or lost on redirect. - API: wrong expected audience/issuer, stale JWKS, clock skew, scope mapping errors.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Access tokens are short-lived bearer credentials.
- Validate issuer, audience, signature and expiry.
- Scopes limit what the token allows.
- API token validation middleware — signature, aud, exp, scope
curl -H 'Authorization: Bearer <token>' <api>— test call- Access token lifetime — minutes, not days
ReferenceWhat it is1 section · depth on demand
Direct Answer
An access token authorises a client to call one API. It is sent as Authorization: Bearer <token>, and the API must check signature (or introspection), issuer, audience, expiry and scopes/roles on every request. 401 means the token itself was rejected; 403 with insufficient_scope means it is valid but not allowed to do this.
ReferenceWhy it matters1 section · depth on demand
Handling access tokens
- Short lifetime (5–60 minutes); the API checks signature, issuer, audience, expiry and scopes on every request.
- Sent as
Authorization: Bearer <token>; anyone holding it can use it, so only over TLS and never in URLs or logs. - Opaque tokens are checked by introspection; JWT tokens are validated locally.
- Use sender-constrained tokens (DPoP, mTLS) for high-value APIs.
ReferenceImportant terms & boundaries2 sections · depth on demand
Token formats
| Format | Validation |
|---|---|
| JWT (self-contained) | Verify signature, iss, aud, exp, scopes locally |
| Opaque (reference) | Call the introspection endpoint |
Keep access tokens short-lived (5–60 minutes). Never send them in URLs; use the Authorization: Bearer header.
In depth
An access token lets a client call an API — on behalf of a user (delegated) or as itself (application-only). The API, called the resource server, must check it on every request.
How it is sent (RFC 6750)
Authorization: Bearer <token> over TLS. Tokens in URL query strings end up in logs and should not be used.
What the API must check
| Check | Why |
|---|---|
Signature (JWT) or introspection active: true (opaque) | Token is genuine and not revoked |
iss | Issued by the trusted authorization server |
aud | Issued for this API — prevents a token for API A being replayed at API B |
exp / nbf | Currently valid |
Scopes (scp/scope) or roles | The specific operation is permitted |
| Token type | Not an ID token presented as an access token (RFC 9068 uses typ: at+jwt) |
Delegated vs application permissions
Delegated tokens carry the user's identity plus scopes the client was consented to; the API should also apply the user's own permissions. Application-only tokens (client credentials grant) carry roles granted to the client itself and no user — common for daemons and automation.
Lifetime
Keep access tokens short-lived (minutes to about an hour). Self-contained JWTs cannot be revoked before expiry; opaque tokens checked through introspection (RFC 7662) can. For high-value APIs, use sender-constrained tokens (mTLS or DPoP) so stolen tokens cannot be replayed.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle and ownership
- Authorization server sets lifetime, format and signing keys, and the API's identifier (audience) and scopes.
- API owner defines scopes/roles, validates tokens and maps them to permissions.
- Client owner requests only needed scopes, stores tokens in memory or secure storage, and renews through the refresh flow.
- Rotation: signing keys rotate at the authorization server; APIs must load keys from JWKS, not hard-code them.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → Access Token. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
| Response | Meaning |
|---|---|
401 + WWW-Authenticate: Bearer error="invalid_token" | Expired, wrong signature, wrong issuer or audience, or revoked |
401 without error | No token sent, or wrong scheme |
403 + error="insufficient_scope" | Token valid but lacks the required scope/role |
400 + error="invalid_request" | Malformed request, e.g. token sent twice or in a disallowed place |
Introspection active: false | Token expired, revoked or unknown to this server |