Skip to main content
An auth credential is how a client proves it may act as a consumer. Credentials are created at the gateway level and attached to one or more consumers, so you can rotate or share them independently of the consumer itself. This is distinct from a registry’s target auth, which is how TrustGate authenticates to the upstream provider.

Auth types

typeHow the client authenticatesRouting mode
api_keyX-AG-API-Key: ag_… headerinline
oauth2Authorization: Bearer <jwt> (or opaque token + introspection) validated against an OAuth2 providerinline or role_based
oidcAuthorization: Bearer <jwt> from your IdP; claims select a roleinline or role_based
mtlsClient certificate (or a trusted X-Forwarded-Client-Cert header)inline
MCP consumers accept api_key, oauth2, and mtls (not oidc). A role_based consumer carries exactly one identity credential — oauth2 or oidc.

API keys

API keys are prefixed ag_. 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 a config block:
TypeConfig fields
oauth2issuer, audiences, jwks_url, introspection_url, client_id/secret, required_scopes, allowed_algorithms, optional session_mode.
oidcissuer, audiences, jwks_url, public_keys, required_scopes, allowed_algorithms, subject_claim.
mtlsca_cert, allowed_common_names, allowed_dns_names, allowed_fingerprints.
For 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.