What it means
OAuth delegates limited API access to a client. An authorization server issues an access token; the client presents it to a resource server. In an authorization-code flow, the owner authenticates with the authorization service without sharing a password with the client. The API validates the token and enforces granted actions and resources; requested scopes may not be granted.
An access token is not an ID token or human sign-in statement. The API must enforce its intended audience and permissions. Whoever possesses a bearer token can use it: an issuance-time client identifier does not prove which application presents it now. Sender-constrained tokens require additional enforced proof. Tokens may be opaque references or structured values; use trusted introspection or appropriate format validation, including expiry and revocation handling.
See the idea / Identity
A valid token can still lack permission.
Use the same delegated read token for a permitted calendar read and a refused event creation. The API enforces the difference.
Fictional CalendarAPI. Mina owns C17. A completed code-with-PKCE flow already delivered CalendarAuth’s cal.read/C17 token to Exporter C7. AT9 is its safe reference. Working HTTPS, valid syntax, and fresh authenticated introspection are assumed.
01 / 04
Context
Exporter C7 holds active bearer access token AT9. Mina delegated cal.read for calendar C17 through CalendarAuth. The client asks CalendarAPI for the existing event E8 without receiving Mina’s password.
More about this step
A completed code-with-PKCE flow, approved cal.read/C17 grant, and receipt are assumed. Mina owns C17; C7 is the client, CalendarAuth the authorization server, CalendarAPI the resource server. AT9 safely labels an opaque, API-restricted token. Issuance, consent, refresh, and revocation are outside this view; C7 gets no owner password.
Step through at your own pace.
Keep in mindThis shows API use after token issuance, not a complete OAuth exchange. AT9 is a reference, not a usable token. An access token is not a human sign-in statement or proof of the client presenting a bearer credential.
Read the visual, step by step
Read E8 · cal.read
- Context. Exporter C7 holds active bearer access token AT9. Mina delegated cal.read for calendar C17 through CalendarAuth. The client asks CalendarAPI for the existing event E8 without receiving Mina’s password. A completed code-with-PKCE flow, approved cal.read/C17 grant, and receipt are assumed. Mina owns C17; C7 is the client, CalendarAuth the authorization server, CalendarAPI the resource server. AT9 safely labels an opaque, API-restricted token. Issuance, consent, refresh, and revocation are outside this view; C7 gets no owner password.
- Request. The client sends its API request with AT9 in the Authorization header over HTTPS. CalendarAPI shows receipt after arrival. No response or new permission has reached the client yet. GET /cal/C17/events/E8 has no body. POST /cal/C17/events carries {"event":"E9"}, its complete synthetic JSON body. Both send the same opaque bearer token in Authorization over assumed working HTTPS with valid syntax. No raw credential is shown or logged. A requested scope adds no grant.
- Check. CalendarAPI finds AT9 active and intended for this API, then checks cal.read and the C17 resource grant. Both permit reading E8. A 200 representation is prepared; the client has not received it yet. Fresh authenticated TLS introspection at CalendarAuth supplies active status, issuer, API audience, expiry, scope, and an agreed C17-grant extension. Token checks pass in both tests; no JWT signature is implied. The API checks the calendar grant and maps read/create to cal.read/cal.write; only read is granted. Bearer possession cannot prove C7 is the caller; sender constraints need additional enforced proof.
- Response. The 200 response travels back to the client with a synthetic E8 copy. After arrival, the client shows E8 received. The original stays in CalendarAPI; delegated reading has not become calendar-writing authority. The complete 200 OK application/json body is {"event":"E8"}. The original remains. One delegated read establishes neither client sign-in nor other actions. An ID token serves a different purpose; the linked field lesson teaches the full OAuth exchange.
Create E9 · cal.write
- Context. Exporter C7 holds the same active bearer access token AT9. Mina delegated cal.read for calendar C17 through CalendarAuth. The client now asks to create E9, which requires cal.write. A completed code-with-PKCE flow, approved cal.read/C17 grant, and receipt are assumed. Mina owns C17; C7 is the client, CalendarAuth the authorization server, CalendarAPI the resource server. AT9 safely labels an opaque, API-restricted token. Issuance, consent, refresh, and revocation are outside this view; C7 gets no owner password.
- Request. The client sends its API request with AT9 in the Authorization header over HTTPS. CalendarAPI shows receipt after arrival. No response or new permission has reached the client yet. GET /cal/C17/events/E8 has no body. POST /cal/C17/events carries {"event":"E9"}, its complete synthetic JSON body. Both send the same opaque bearer token in Authorization over assumed working HTTPS with valid syntax. No raw credential is shown or logged. A requested scope adds no grant.
- Check. CalendarAPI finds AT9 active and intended for this API. It still refuses the create operation: the granted cal.read scope does not include cal.write. E9 is not created; AT9 remains valid. Fresh authenticated TLS introspection at CalendarAuth supplies active status, issuer, API audience, expiry, scope, and an agreed C17-grant extension. Token checks pass in both tests; no JWT signature is implied. The API checks the calendar grant and maps read/create to cal.read/cal.write; only read is granted. Bearer possession cannot prove C7 is the caller; sender constraints need additional enforced proof.
- Response. The refusal response travels back to the client. After arrival, it shows 403 Forbidden with insufficient_scope. No E9 was created. The original E8 and AT9’s read grant remain unchanged. The bodyless 403 Forbidden includes WWW-Authenticate: Bearer error="insufficient_scope". No E9 is created; E8, AT9, cal.read, and working transport remain intact. The delivered refusal concerns this operation, not an invalid token or failed owner sign-in.
This shows API use after token issuance, not a complete OAuth exchange. AT9 is a reference, not a usable token. An access token is not a human sign-in statement or proof of the client presenting a bearer credential.
Flow references: RFC 6749 - OAuth roles and resource access · RFC 6750 - bearer tokens and insufficient scope · RFC 7662 - opaque-token introspection · RFC 9700 - token audience and sender constraints
AN ILLUSTRATIVE SCENARIO
Chronos Hub connects a calendar
Meridian Space & Robotics lets ground-station operators show orbital pass windows in a calendar product. The connector receives an access token whose requested scope is read-only windows for assigned satellites. Vera checks that Chronos Hub’s API refuses that token when the connector asks for the customer-telemetry export. The token can be valid, unexpired, and still unauthorized for that action. When an operator leaves, the team revokes the grant and confirms the connector cannot refresh it.
Put it to work
- Name the client, authorization server, resource server, intended audience, and allowed scopes. Write the actions the token must not perform.
- Validate opaque tokens with authenticated introspection, or structured tokens with appropriate issuer, audience, signature, and time checks. Enforce actions and resources in the API; use sender constraints where presenter binding is needed.
- Test allowed and out-of-scope calls, a different API audience, and revocation. Record how refresh and connector offboarding work.
How to check your work
Use the same test token for an allowed and out-of-grant call; only the allowed call succeeds. Test expired, revoked, and wrong-API tokens. For sender-constrained tokens, test rejection without the required proof. Another holder of a plain bearer token is not automatically distinguishable.
Connect the ideas
- Federation
Trusting authentication assertions from an external identity provider instead of storing every password locally.
- SSO
A pattern where one authentication to an identity provider is reused across multiple applications.
- Authorization
The decision about whether a person, device, workload, or anonymous requester may perform a particular action on a resource.
- Authentication
The act of verifying a claimed identity with authenticators such as passwords, passkeys, or certificates.