Penv Cloud
Start free
Docs
Reference

Pocket ID

Services authenticate with a Pocket ID client whose id is your workspace id. One identity per Pocket ID per workspace.

Services authenticate with a Pocket ID client whose id is your workspace id. One identity per Pocket ID per workspace.

Identity proof

The token has to come from https://id.acme.com, and its sub claim has to hold client-YOUR_WORKSPACE_ID, which we build from your workspace id. We compare that claim byte for byte, with no wildcards.

That value is the same for every identity on the issuer, so your workspace connects one per issuer. A second connect on it is refused until you revoke the first.

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
Pocket ID URLhttps://id.acme.comnoYour APP_URL, with INTERNAL_APP_URL unset. Must be reachable from the internet. Its client id is your workspace id, so this is your one Pocket ID identity here.

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://id.acme.com
Claim comparedsub
Subjectclient-YOUR_WORKSPACE_ID
Identity namepocketid-id-acme-com

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

Console snippet

# Pocket ID, once: Administration → OIDC Clients → Add, with
#   Client ID (custom) = YOUR_WORKSPACE_ID
#   Public client off, no callback URL.
#   Then turn on group restriction with no group selected.
# We know this client only by its id, which is your workspace id, so:
#   use the client for Penv alone: every token it gets names your workspace, wherever it is sent;
#   Pocket ID cannot turn off its other grants, so group restriction with no group selected keeps every user out;
#   one identity per Pocket ID per workspace, since the client id is now taken.
# Ask for this audience and no other. A token requested for two audiences fails every exchange.
# Send no resource parameter: it replaces the audience.
# $POCKET_ID_CLIENT_SECRET is this client's own secret, already on the machine.
URL=$(curl -fsS "<POCKET_ID_URL>/.well-known/openid-configuration" | jq -r .token_endpoint)
T=$(jq -jn --arg id "YOUR_WORKSPACE_ID" \
  '"grant_type=client_credentials&client_id=\($id|@uri)&client_secret=\((env.POCKET_ID_CLIENT_SECRET // "" | if . == "" then error("POCKET_ID_CLIENT_SECRET is not set") else . end)|@uri)"' \
  | curl -fsS "$URL" --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.