Guide
API operations
API authentication patterns
API keys, OAuth, mTLS and signed requests: which authentication pattern fits which client, and the mistakes that leak credentials.
Authentication is not authorization
Proving who is calling is authentication. Deciding what they may do is authorization. Mixing them is how a leaked browser token becomes an admin API.
Common patterns
- API keys: simple for server-to-server. Send over TLS only. Rotate. Do not put them in mobile apps or front-end JavaScript.
- OAuth 2.0 / OIDC: delegated access for user-owned data. Use short-lived access tokens and refresh tokens stored as carefully as passwords.
- JWT bearer tokens: convenient and easy to misuse. Verify signature, issuer, audience and expiry. Decoding is not verification (try the JWT decoder to see the difference).
- mTLS: both sides present certificates. Strong for private networks; operationally heavier.
Practical rules
Prefer the simplest pattern that matches the client. Log key ids, not secrets. See secrets management.
Related
Last verified: August 2026. Technology and pricing change — always confirm current details with the vendor.