Skip to main content

Authentication Methods

Zerq supports five authentication types for client profiles. Choose based on how callers obtain identity and what level of assurance you need.


Comparison

Auth TypeMechanismRequired HeadersToken SourceWhen to Use
tokenZerq-issued opaque bearer tokenX-Client-ID, X-Profile-ID, Authorization: Bearer <token>Zerq generates at profile creation or rotationSimple server-to-server; no IdP dependency
jwtHMAC-signed JWT validated by ZerqX-Client-ID, X-Profile-ID, Authorization: Bearer <jwt>Client signs each request with client secretShort-lived claims, stateless validation
oidcRSA-signed ID token from an external IdPX-Client-ID, X-Profile-ID, Authorization: Bearer <id_token>Identity provider (e.g. Keycloak) issues tokensEnterprise SSO, role-aware auth via IdP
mtlsClient TLS certificate validated at the gatewayX-Client-ID, X-Profile-ID (no Authorization header needed)Client presents certificate in TLS handshakeMachine-to-machine with certificate infrastructure
noneNo authentication checkX-Client-ID, X-Profile-IDN/AOpen/internal endpoints, health checks

Decision guide

Use token when:

  • The caller is a server-side service you control
  • You want Zerq to manage credentials with no external IdP
  • Simplicity is more important than short token lifetimes

Use jwt when:

  • You need short-lived tokens (set expiry in minutes or hours)
  • The caller can sign JWTs using HMAC (HS256)
  • You want to embed custom claims (e.g. role, tenant_id) in the token

Use oidc when:

  • Your organization has an identity provider (Keycloak, Auth0, Okta, Azure AD)
  • You want tokens to carry RSA-signed identity assertions
  • Single sign-on is required across multiple services

Use mtls when:

  • You need strong machine identity at the TLS layer
  • Certificate rotation and revocation are already part of your infrastructure
  • Regulated environments require mutual authentication (PCI-DSS, HIPAA)

Use none when:

  • The endpoint is intentionally public (e.g. health check, webhook receiver)
  • The service is on a trusted internal network not exposed externally
  • You need a temporary bypass during development (never use in production for sensitive endpoints)

Status code mapping

CodeCauseAuth types affected
401 UnauthorizedToken missing, expired, or invalid signaturetoken, jwt, oidc
401OIDC token issued by wrong IdPoidc
401JWT signature validation failedjwt
403 ForbiddenValid identity, but access denied (wrong collection, inactive profile, IP blocked)all
405 Method Not AllowedProfile allowed_methods restrictionall
429 Too Many RequestsPolicy rate limit or quota exhaustedall

Auth method guides