On this page
Before you start: the admin role (or Change on Organization settings and security), MFA if enrolled, a Dex client with Principal enabled, and the program’s issuer, subject and audience.
- Open People → Create → Create service account, enter Name (Release agent) and click Create service account (note External ID).
- Under Token exchange, click Add trusted token.
- Enter exact Issuer, Subject, Audience (add Public keys (optional) if unreachable). Click Add trusted token and confirm MFA.
- Assign an application rule (Put a web application behind Principal sign-in).
- Exchange the token for a Dex
access_token(connector_id:principal-<APP_ID>):bashcurl -s https://dex.example.com/token \ -d grant_type=urn:ietf:params:oauth:grant-type:token-exchange \ -d client_id=vault -d connector_id=principal-$APPLICATION_ID \ -d subject_token="$SUBJECT_TOKEN" -d scope="openid groups" \ -d subject_token_type=urn:ietf:params:oauth:token-type:id_token \ -d requested_token_type=urn:ietf:params:oauth:token-type:id_token
Trust appears under Token exchange (Pasted keys if supplied). Click Remove to block future exchanges (issued tokens last until expiry).
Issuer and subject of common programs#
| Program | Issuer | Subject | Setup |
|---|---|---|---|
GitLab CI |
https://gitlab.example.com |
project_path:billing/api:ref_type:branch:ref:main |
Set id_tokens.<VAR>.aud. |
GitHub Actions |
https://token.actions.githubusercontent.com |
repo:acme/billing:ref:refs/heads/main |
permissions: id-token: write. |
Kubernetes |
kubectl get --raw /.well-known/openid-configuration |
system:serviceaccount:<ns>:<name> |
Projected token. Paste /openid/v1/jwks if unreachable. |