Skip to content

Authentication methods

How a consumer proves identity to Dwara. Each method is a credential family: a consumer holds one or more, and the gateway verifies the presented credential against the configured material. This page is the quick-reference for choosing a method; each method's detail lives on its own page.

For the broader security model -- secrets, authorization, upstream authn -- see Security and identity.

When to use this

  • You are deciding how callers should authenticate to the gateway -- this page compares the five families and links to each method's detail page.
  • Different caller populations need different credentials (API keys for services, JWTs for end users, mTLS for partner traffic); the families compose per consumer.

Method reference

MethodWhat it checksBest forGuide
API keya shared secret in a header or query parametersimple service-to-service, internal APIsSecurity
HTTP BasicRFC 7617 username/passwordlegacy clients, quick prototypesSecurity
JWT (JWKS)a Bearer token verified against a JWKS endpointstateless auth, OAuth2 resource serversSecurity
mTLS client certa verified client certificate mapped to a consumerzero-trust internal mesh, high-assurancemTLS
HMAC request signingper-request HMAC-SHA256 over a canonical requestmachine-to-machine integrity, replay protectionHMAC signing
OIDCBearer introspection (RFC 7662) or browser login + PKCEuser-facing apps, delegated accessOpenID Connect

Choosing a method

  • Service-to-service, internal: an API key is the simplest. Add HMAC request signing when you need per-request integrity and replay protection without a shared bearer token.
  • Stateless, externally issued tokens: JWT via JWKS. The gateway fetches and caches the JWKS, verifies the signature and claims, and maps the token to a consumer. No shared secret with the issuer.
  • High-assurance internal: mTLS client certificates. Each client presents a cert; the gateway maps the cert's subject or SPIFFE ID to a consumer. No credential in the request body at all.
  • User-facing applications: OIDC. The gateway acts as a relying party (authorization-code + PKCE) for browser login, or introspects a Bearer token via RFC 7662 for API access.

A single consumer can hold multiple credential families, so you can migrate methods without reissuing identity -- add the new family, shift traffic, then remove the old.

Upstream authentication

Separately from consumer authn, the gateway can authenticate itself to an upstream as an OAuth2 client-credentials client, or present an mTLS client certificate. That is upstream authn, not consumer authn; see OAuth2 and mTLS.

Runnable demo

Check credentials against a live gateway: demos/04-security-auth/ (test scripts: test-01-api-key-auth.sh, test-02-basic-auth.sh, test-04-mtls-auth.sh, test-05-hmac-signing.sh, test-17-jwt-jwks.sh, test-18-oidc.sh) in the repository. The category README covers prerequisites and teardown.

Where to go next