Penv Cloud
Start free
Docs
Reference

Gravitee Access Management

Services authenticate with a Gravitee AM application whose client id is your workspace id. One identity per security domain per workspace.

Services authenticate with a Gravitee AM application whose client id is your workspace id. One identity per security domain per workspace.

Identity proof

The token has to come from https://am.acme.com/acme/oidc, and its sub claim has to hold 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
Issuer URLhttps://am.acme.com/acme/oidcnoThe issuer of https://<gateway>/<domain>/oidc/.well-known/openid-configuration. Must be reachable from the internet. Its client id is your workspace id, so this is your one identity per domain 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://am.acme.com/acme/oidc
Claim comparedsub
SubjectYOUR_WORKSPACE_ID
Identity namegravitee-am-acme-com-acme

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

Console snippet

# Gravitee AM, once, in the security domain: a new Service application, not an agent, with
#   Client ID = YOUR_WORKSPACE_ID
#   Grant types = Client Credentials only, token endpoint auth method client_secret_post
#   Certificate = the domain's RSA certificate. With none selected the token is signed with HMAC.
# Elsewhere on the domain, so no other application can mint the same token:
#   no protected resource whose identifier is YOUR_WORKSPACE_ID;
#   legacy.rfc8707.enabled left at its default;
#   no agent application able to assert YOUR_WORKSPACE_ID as its SPIFFE or agent id, since an
#   agent's sub is the id it asserts.
# 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;
#   allow it client credentials and no other grant, so nobody signs in through it;
#   one identity per security domain 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.
# Call the public gateway URL: the issuer is taken from the host the request arrives on.
# $GRAVITEE_CLIENT_SECRET is this application's own secret, already on the machine.
URL=$(curl -fsS "<ISSUER>/.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.GRAVITEE_CLIENT_SECRET // "" | if . == "" then error("GRAVITEE_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.