HTTP Authentication Methods

HTTP authentication schemes: Basic, Bearer (JWT), Digest, OAuth 2.0, Mutual TLS, and modern alternatives like WebAuthn and passkeys.

  • JSON8,669 B
  • YAML6,165 B · −29%
  • TOON5,513 B · −36%

HTTP authentication schemes compared with their RFC, header, security level, typical uses and notes, from Basic and Bearer tokens to OAuth 2.0, OpenID Connect, mutual TLS, API keys and WebAuthn passkeys, followed by a short list of best practices.

Use it when

  • You are choosing an authentication scheme for an API or web application.
  • You need the header format and security properties of each.

Watch out for

  • A scheme is only as strong as its deployment: HTTPS is required for Basic and Bearer, and tokens must be stored, scoped and revoked properly.
  • OAuth 2.0 is an authorization framework; authentication needs OpenID Connect or another layer.

The data

Schemes

NameRfcHeaderSecurityUse casesNotes
Basic AuthenticationRFC 7617Authorization: Basic base64(username:password)Low (credentials sent with every request, base64 is encoding not encryption)
  • Simple internal tools
  • Development/testing
  • Service-to-service with HTTPS only
Always use HTTPS; consider rotating credentials; prefer token-based auth for production
Bearer Token (JWT)RFC 6750, RFC 7519Authorization: Bearer <jwt_token>Medium (stateless, self-contained, but token theft = full access)
  • SPA + API
  • Mobile apps
  • Microservices
  • Third-party integrations
Use short-lived access tokens (15min) + refresh tokens; store in httpOnly cookies for web; never in localStorage for XSS-prone apps
Digest AuthenticationRFC 7616Authorization: Digest username="user", realm="...", nonce="...", uri="...", response="..."Medium (password not sent in clear, but vulnerable to MITM without HTTPS)
  • Legacy systems
  • WebDAV
  • IP cameras
  • Embedded devices
Rarely used in modern web apps; OAuth 2.0 / JWT preferred
OAuth 2.0RFC 6749, RFC 6750Authorization: Bearer <access_token>High (when implemented correctly with PKCE, short-lived tokens, secure storage)
  • Third-party authorization
  • SSO
  • API delegation
  • Mobile/web app auth
Use OAuth 2.1 (draft): enforces PKCE, removes implicit flow, requires refresh token rotation
OAuth 2.0 + OpenID ConnectOpenID Connect Core 1.0Authorization: Bearer <id_token + access_token>High (adds identity layer on top of OAuth 2.0)
  • User authentication (not just authorization)
  • SSO across domains
  • Social login
ID token (JWT) contains user identity claims; access token for API access
Mutual TLS (mTLS)RFC 8705Client certificate in TLS handshakeVery High (certificate-based,双向认证)
  • Service-to-service (zero-trust)
  • High-security APIs
  • Financial APIs
  • B2B integrations
Server validates client certificate; often combined with OAuth 2.0 (OAuth 2.0 mTLS sender-constrained tokens)
API KeysN/A (convention)X-API-Key: <key> OR Authorization: ApiKey <key>Low-Medium (no standardization, key theft = full access, no expiry by default)
  • Developer API access
  • Rate limiting by key
  • Simple service access
  • Analytics/tracking
Not an authentication scheme per se; use for identification, not authentication; rotate keys; set expiry
WebAuthn / PasskeysW3C WebAuthn Level 3, FIDO2Public key credential assertion in JSON (not HTTP header based)Very High (phishing-resistant, hardware-backed, no shared secrets)
  • Passwordless login
  • MFA second factor
  • Mobile app authentication
  • Enterprise SSO
Uses public key cryptography; server stores public key, client holds private key; supported by all major browsers

Best practices

  • Always use HTTPS (TLS 1.2+)
  • Use short-lived access tokens (15-60 min) with refresh token rotation
  • Store tokens in httpOnly, Secure, SameSite cookies for web apps (not localStorage)
  • Implement token revocation (blacklist or short TTL)
  • Use PKCE for public clients (SPAs, mobile apps)
  • Validate token audience (aud claim) and issuer (iss claim)
  • Implement rate limiting per authenticated identity
  • Log authentication events for anomaly detection

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
schemesnamestringBasic Authentication
schemesrfcstringRFC 7617
schemesheaderstringAuthorization: Basic base64(username:password)
schemessecuritystringLow (credentials sent with every request, base6…
schemesuse_casesarray[3 items]
schemesnotesstringAlways use HTTPS; consider rotating credentials…
best_practices*array[8 items]

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/http-authentication-methods?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/http-authentication-methods.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • http
  • authentication
  • basic
  • bearer
  • jwt
  • oauth2
  • digest
  • webauthn
  • passkeys

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets