Docs
Live demo
POST/api/v2/identities/{id}/token-exchange-trusts
security:manageConsole session only

Let the service account sign in to applications with a token of another issuer, for example a GitLab CI job token, a GitHub Actions token or a Kubernetes ServiceAccount token. Principal accepts a token only when its iss equals issuer, its sub equals subject exactly, its aud contains audience, it is not expired and its signature matches the keys of the issuer. Without jwks Principal reads the keys through OIDC discovery of the issuer, only from public addresses. jwks holds the public keys of an issuer Principal can't reach. The rules of each application still decide whether the service account signs in. An API token makes this change only when it was issued with allow_security_changes.

Parameters

Path1 required of 1
idstringpathrequired

Identity ID (UUID) of the service account

Request body application/json · ServiceAccountTokenTrustCreateRequest

Required3 of 4 fields
issuerstringrequired

The iss claim of the token, an https URL.

max length 512
subjectstringrequired

The sub claim of the token, compared exactly.

max length 512
audiencestringrequired

A value the aud claim of the token must contain.

max length 512
Optional1 field
jwksstring

Public signing keys of the issuer as a JWKS document, for an issuer Principal can't reach.

max length 65536

Responses

201

Created

ServiceAccountTokenTrustResponse · 7 fields
idstring · uuidrequired
identity_idstring · uuidrequired
issuerstringrequired
subjectstringrequired
audiencestringrequired
key_sourcestringrequired

discovery when Principal reads the keys of the issuer, static when keys were pasted.

discoverystatic
created_atstring · date-timerequired
400

Bad Request: the user is not a service account, the issuer is not an https URL, a field is empty or too long, jwks is not a set of public signing keys, or the service account already trusts 20 tokens.

403

Forbidden: the caller's roles do not grant the permission of the operation, the administrator's second factor was not confirmed recently (details.reason=mfa_reauth_required), or the request uses an API token issued without allow_security_changes (details.reason=api_token_security_changes_not_allowed).

404

Not Found: no such user in the organization, or no such trusted token of this user.

409

Conflict: another service account of the organization already trusts this issuer and subject, or the idempotency key was reused with another request.

Common errors: 401 413 429 503 504. They mean the same for every operation, see Errors.

↑ ↓ to moveEnter to openEsc to close