Auth types
type | How the client authenticates | Routing mode |
|---|---|---|
api_key | X-AG-API-Key: ag_… header | inline |
oauth2 | Authorization: Bearer <jwt> (or opaque token + introspection) validated against an OAuth2 provider | inline or role_based |
oidc | Authorization: Bearer <jwt> from your IdP; claims select a role | inline or role_based |
mtls | Client certificate (or a trusted X-Forwarded-Client-Cert header) | inline |
api_key, oauth2, and mtls (not oidc). A role_based consumer
carries exactly one identity credential — oauth2 or oidc.
API keys
API keys are prefixedag_. The raw secret is returned once, at creation — store
it then. TrustGate only persists a SHA-256 hash; at request time it hashes the inbound key
and compares, so the secret is never recoverable from the gateway.
OAuth2 / OIDC / mTLS
JWT- and certificate-based credentials carry aconfig block:
| Type | Config fields |
|---|---|
oauth2 | issuer, audiences, jwks_url, introspection_url, client_id/secret, required_scopes, allowed_algorithms, optional session_mode. |
oidc | issuer, audiences, jwks_url, public_keys, required_scopes, allowed_algorithms, subject_claim. |
mtls | ca_cert, allowed_common_names, allowed_dns_names, allowed_fingerprints. |
oidc credentials on a role_based consumer, the validated token’s claims are
matched against role OIDC mappings to select the consumer’s
routing — this is how identity-based routing works.
Managing auth
CRUD lives under/v1/gateways/{gateway_id}/auths; attach/detach via the consumer’s
…/auths/{auth_id} sub-resource. See the Auth API.
Next: govern traffic with policies.