Auth types
type | How the client authenticates | Routing mode |
|---|---|---|
api_key | X-AG-API-Key: ag_… header | inline |
oauth2 | Authorization: Bearer <jwt> validated against an OAuth2 provider | inline |
idp | Authorization: Bearer <jwt> from your IDP; claims select a role | role_based |
mtls | Client certificate | inline |
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 / IDP / 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. |
idp | issuer, audiences, jwks_url, public_keys, required_scopes, allowed_algorithms, subject_claim. |
mtls | ca_cert, allowed_common_names, allowed_dns_names, allowed_fingerprints. |
idp credentials, the validated token’s claims are matched against role
IDP 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.