WSO2 Identity Server
Services authenticate with the WSO2 Identity Server application they run as.
Services authenticate with the WSO2 Identity Server application they run as.
Identity proof
The token has to come from https://is.acme.com/oauth2/token, 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://is.acme.com/oauth2/token | no | The issuer your /oauth2/token/.well-known/openid-configuration shows, port and tenant path included. Set [server] hostname in deployment.toml to the public host and serve a publicly trusted certificate first. |
| Client ID | 1u31N7of6gCNR9FqkG1neSlsF_Qa | no | Applications → your M2M application → Protocol → Client ID. Every machine holding its 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://is.acme.com/oauth2/token |
| Claim compared | sub |
| Subject | 1u31N7of6gCNR9FqkG1neSlsF_Qa |
| Identity name | wso2is-is-acme-com-1u31n7of6gcnr9fqkg1neslsf-qa |
We name the identity for you, so the form never asks for one.
Console snippet
# WSO2 Identity Server 7.1 or later, once, in the root organization. The M2M application's
# access token type is JWT.
# In deployment.toml, set [server] hostname (and proxy_port behind a proxy) to the public host,
# and serve a publicly trusted certificate: discovery publishes that host, and the default
# wso2carbon keystore is self-signed.
# Actions → Pre Issue Access Token, calling an HTTPS endpoint you host. When event.request.clientId
# is this application's and event.request.grantType is client_credentials, it answers with a
# replace of aud/0, then a remove of every aud index from 1 up, if present, counted in the aud
# list it received. With two entries that is:
# {"actionStatus":"SUCCESS","operations":[
# {"op":"replace","path":"/accessToken/claims/aud/0","value":"YOUR_WORKSPACE_ID"},
# {"op":"remove","path":"/accessToken/claims/aud/1"}]}
# Every other request gets no operation. Set the action's rule to Application equals this
# application AND Grant type equals client_credentials, so an outage of your endpoint stops only
# this application's tokens. Keep the clientId and grantType check above as a second line of
# defence.
# Ask for this audience and no other. A token requested for two audiences fails every exchange.
# $WSO2_CLIENT_ID and $WSO2_CLIENT_SECRET are this application's own, already on the machine.
URL=$(curl -fsS "<ISSUER>/.well-known/openid-configuration" | jq -r .token_endpoint)
T=$(jq -jn \
'"grant_type=client_credentials&client_id=\((env.WSO2_CLIENT_ID // "" | if . == "" then error("WSO2_CLIENT_ID is not set") else . end)|@uri)&client_secret=\((env.WSO2_CLIENT_SECRET // "" | if . == "" then error("WSO2_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 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
- WSO2 Identity Server documentation: the subject is the value most often set wrong