Docs
Reference

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

FieldExampleAdvancedWhat it pins
TeamCity URLhttps://teamcity.acme.comnoMust be reachable from the internet for us to read its signing keys.
Subject_Root:project31:bt32noThe build configuration path the plugin prints. A personal build prefixes each part with user{id}_ and is a different identity.
Issuer URLhttps://oidc.acme.com/teamcityyesSet 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:

WhatValue
Issuerhttps://teamcity.acme.com/app/oidc-jwt
Claim comparedsub
Subject_Root:project31:bt32
Identity nameteamcity-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 pull

The 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.