Access Token
An access token is a credential that authorizes calls to a protected API on behalf of a user or application. OAuth providers issue access tokens with a limited lifetime and scopes. APIs validate the token signature or call an introspection endpoint before executing the request.
Technical Architecture & Deep-Dive
Access tokens may be JWTs with embedded claims or opaque strings meaningful only to the issuer. Clients send them as bearer tokens in the Authorization header. Short expirations limit damage if exfiltrated, while scopes restrict which resources and actions each token may perform.
Public clients should receive narrowly scoped tokens from an edge layer rather than upstream admin credentials. Gateways verify expirations, audiences, and issuer signatures at the edge, then attach separate upstream secrets only inside trusted infrastructure.
Key Architectural Benefits
Implement Access Token at the Edge
Deploy lightweight API aggregation, edge caching, and secret injection in minutes without Docker containers or complex servers.
Frequently Asked Questions
Q:What happens when an access token expires mid-request?
The API returns 401. Clients should refresh using a secure server-held refresh token or prompt re-authentication instead of embedding long-lived secrets.
Related Architecture Concepts
A refresh token is a long-lived OAuth credential used only to obtain new access tokens without asking the user to sign in again. Refresh tokens are highly sensitive: anyone who steals one can mint fresh access tokens until the refresh token is revoked or expires.
A bearer token is an access credential sent in the HTTP Authorization header as Bearer followed by the token. Whoever bears, or holds, the token is granted access, without additional proof of identity, so bearer tokens must be transmitted only over HTTPS and kept confidential.
OAuth scopes are named permission strings that define what an access token is allowed to do, such as read contacts or write payments. During authorization, the user or admin approves requested scopes, and the issued token carries only those grants.
A JSON Web Token (JWT) is a compact, URL-safe token containing a JSON payload of claims, such as user ID and expiration, signed by the issuer. Servers verify the signature to trust the claims without a database lookup, enabling stateless authentication.
Ready-to-Use Edge Recipes
Intercom contacts and events via edge proxy with server-side Bearer token. For "hide intercom access token in react app", store INTERCOM_ACCESS_TOKEN in Secret Vault, call https://api.intercom.io/contacts from a Worker, and let React hit only https://realcomposer.com/v1/workspace/hide-intercom-access-token-react with an rc_live_ client token.
Vault-inject OAuth or integration tokens at the edge; React calls one public client token URL. For "call salesforce api from react without exposing access token", store SALESFORCE_ACCESS_TOKEN in Secret Vault, call https://{{secrets.SALESFORCE_INSTANCE}}.my.salesforce.com/services/data/v68.0/sobjects/Contact/{{query.contactId}} from a Worker, and let React hit only https://realcomposer.com/v1/workspace/call-salesforce-api-from-react-securely with an rc_live_ client token.
Frontend / Web cannot safely store GitHub production keys. Vault-bound headers reach https://api.github.com/user/repos?per_page=5 on Workers while apps call your github-api-private-token-proxy edge URL.