TeamCity
Builds authenticate with an ID token your TeamCity server signs itself.
Builds authenticate with an ID token your TeamCity server signs itself.
What proves the identity
The token has to come from https://teamcity.acme.com/app/oidc-jwt, and its sub claim has to match the workload you named. penv compares that claim byte for byte, with no wildcards.
Every token also has to name your workspace as its audience. Ask for this audience and no other. A token requested for two audiences fails every exchange.
What the console asks for
| Field | Example | Advanced | What it pins |
|---|---|---|---|
| TeamCity URL | https://teamcity.acme.com | no | Must be reachable from the internet for us to read its signing keys. |
| Subject | _Root:project31:bt32 | no | The build configuration path the plugin prints. A personal build prefixes each part with user{id}_ and is a different identity. |
| Issuer URL | https://oidc.acme.com/teamcity | yes | Set a full URL only if the plugin publishes its documents on another host. |
A field marked advanced carries a default and stays behind the disclosure until you open it.
The console also asks which project and environment this identity reaches and which role it gets, with the credential lifetime behind Advanced.
What the trust holds
Built from the example answers above:
| What | Value |
|---|---|
| Issuer | https://teamcity.acme.com/app/oidc-jwt |
| Claim compared | sub |
| Subject | _Root:project31:bt32 |
| Identity name | teamcity-root-project31-bt32 |
penv names the identity for you, so the form never asks for one.
The snippet the console prints
# Build feature: OIDC JWT, on demand. Ask for this audience and no other. A token requested for two audiences fails every exchange.
# In a Command Line build step:
T=$(curl -sS -u "%system.teamcity.auth.userId%:%system.teamcity.auth.password%" \
"%teamcity.serverUrl%/app/oidc-jwt/issue" --get --data-urlencode "aud=YOUR_WORKSPACE_ID" \
| grep -o 'ey[A-Za-z0-9._-]*')
C=$(curl -sS "https://penv.cloud/api/v1/auth/oidc" \
-H 'content-type: application/json' \
-d "{\"token\":\"$T\"}" | jq -r .credential)
PENV_TOKEN="$C" penv pullThe snippet finishes with penv pull, which writes a file. penv run is the path the docs teach for a process, and penv pull is for a host that needs a file on disk. Connect your CI has the wrapped step.
Related
- Machine identity
- Connect a Platform in the console
- TeamCity documentation, where the value people get wrong is always the subject