Okta
A service app authenticates as its own client id.
A service app authenticates as its own client id.
What proves the identity
The token has to come from https://acme.okta.com/oauth2/default, 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 |
|---|---|---|---|
| Okta domain | acme.okta.com | no | |
| Client ID | 0oa1b2c3d4e5f6g7h8i9 | no | The service app's client ID, which is also the subject on its tokens. |
| Authorization server | default | yes | The custom server whose Audience you set to your org id, which needs API Access Management. Ask for this audience and no other. A token requested for two audiences fails every exchange. |
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://acme.okta.com/oauth2/default |
| Claim compared | sub |
| Subject | 0oa1b2c3d4e5f6g7h8i9 |
| Identity name | okta-0oa1b2c3d4e5f6g7h8i9 |
penv names the identity for you, so the form never asks for one.
The snippet the console prints
# Okta: a custom authorization server whose Audience is YOUR_WORKSPACE_ID,
# with a scope named penv this service app is allowed to request.
# Set this app's client authentication to "Client secret (POST)".
# Ask for this audience and no other. A token requested for two audiences fails every exchange.
# $OKTA_CLIENT_SECRET is this client's own secret, already on the machine.
T=$(printf 'grant_type=client_credentials&client_id=%s&client_secret=%s&scope=penv' \
"$OKTA_CLIENT_ID" "$OKTA_CLIENT_SECRET" \
| curl -sS https://<OKTA_DOMAIN>/oauth2/<AUTH_SERVER_ID>/v1/token --data-binary @- \
| jq -r .access_token)
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
- Okta documentation, where the value people get wrong is always the subject