Penv Cloud
Start free
Docs
Reference

Okta

A service app authenticates as its own client id.

A service app authenticates as its own client id.

Identity proof

The token has to come from https://acme.okta.com/oauth2/default, and its sub claim has to match the workload you named. We compare 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.

Console fields

FieldExampleAdvancedWhat it pins
Okta domainacme.okta.comno
Client ID0oa1b2c3d4e5f6g7h8i9noThe service app's client ID, which is also the subject on its tokens.
Authorization serverdefaultyesThe 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.

Trust

Built from the example answers above:

WhatValue
Issuerhttps://acme.okta.com/oauth2/default
Claim comparedsub
Subject0oa1b2c3d4e5f6g7h8i9
Identity nameokta-0oa1b2c3d4e5f6g7h8i9

We name the identity for you, so the form never asks for one.

Console snippet

# 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=$(T="$T" jq -n '{token:env.T}' | curl -sS "https://penv.cloud/api/v1/auth/oidc" \
  -H 'content-type: application/json' --data-binary @- | jq -r .credential)
PENV_TOKEN="$C" penv pull

The snippet finishes with penv pull, which writes a file. We recommend penv run for a process; penv pull is for a host that needs a file on disk. Connect your CI has the wrapped step.