FusionAuth
Services authenticate as the FusionAuth entity they run as.
Services authenticate as the FusionAuth entity they run as.
Identity proof
The token has to come from https://acme.fusionauth.io, 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
| Field | Example | Advanced | What it pins |
|---|---|---|---|
| Issuer URL | https://acme.fusionauth.io | no | Tenants → your tenant → General → Issuer: https://<host> for the default tenant, https://<host>/<tenant id> for any other. Changing it changes iss for every app on that tenant. |
| Entity ID | 2934f41f-d277-4a32-b0d5-16e47dad9721 | no | Entity Management → Entities → the entity your workload runs as. Every machine holding its client secret matches. |
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:
| What | Value |
|---|---|
| Issuer | https://acme.fusionauth.io |
| Claim compared | sub |
| Subject | 2934f41f-d277-4a32-b0d5-16e47dad9721 |
| Identity name | fusionauth-16e47dad9721 |
We name the identity for you, so the form never asks for one.
Console snippet
# Once, as an admin:
# Entity Types → the type of the entity your workload runs as → JWT: enable the override and
# pick an RSA or EC (P-256 or P-384) access token signing key. HMAC keys publish nothing we
# can verify with.
# Entity Management → Entities: create the target entity, of any entity type, with Id
# YOUR_WORKSPACE_ID, then grant the entity your workload runs as access to it.
# <FUSIONAUTH_URL> is the bare host, with no tenant id in the path.
# Request this one target entity and no other: two targets put two audiences in the token.
# $FA_CLIENT_ID and $FA_CLIENT_SECRET are the workload entity's, already on the machine.
T=$(jq -jn --arg aud "YOUR_WORKSPACE_ID" \
'"grant_type=client_credentials&client_id=\((env.FA_CLIENT_ID // "" | if . == "" then error("FA_CLIENT_ID is not set") else . end)|@uri)&client_secret=\((env.FA_CLIENT_SECRET // "" | if . == "" then error("FA_CLIENT_SECRET is not set") else . end)|@uri)&scope=target-entity:\($aud)"' \
| curl -fsS "<FUSIONAUTH_URL>/oauth2/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 pullThe 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.
Related
- Machine identity
- Connect a Platform in the console
- FusionAuth documentation: the subject is the value most often set wrong