Skip to content
Workforce IdentityMarkdown

Choose how ID tokens are signed

Pick the algorithm an app's ID tokens are signed with (RS256, ES256 or PS256), and which ones the realm offers.

APIOpenID Connect Core 1.0, RFC 7518

Each app gets its ID tokens signed with the algorithm it can check, signed with the realm’s key for that algorithm and published in the realm’s key set. Use this when an app’s library or policy needs a particular algorithm.

AlgorithmWhen
RS256The default. Every OpenID Connect library supports it
ES256Smaller tokens and faster signing. The algorithm access tokens always use
PS256Where RSA is required but RS256 isn’t allowed, as under FAPI 2.0

Access tokens are always ES256, whatever you choose here.

Before you start:

  • Who can do it: a realm administrator, in a group that holds RealmOwner (Delegated administration). RealmViewer can read the settings but not change them.
  • Where: today this is done through the API; Call the API shows how to get $CVYUH_SESSION.
  • First: have the app’s client ID.
  1. For PS256 only, offer it in the realm. The realm offers RS256 and ES256 by default, and always RS256, as OpenID Connect requires:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/keySettings/keySettings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "algorithm": { "oauth2": { "idToken": ["RS256", "ES256", "PS256"] } } }'
  2. Set the app’s algorithm:

    Terminal window
    curl -X PATCH 'https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Client/<client-id>' \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "idTokenSignedResponseAlg": "ES256" }'

Sign in to the app and decode the ID token’s header: its alg is the one you set, and its kid is in the realm’s key set.

SymptomCauseFix
The sign-in fails with no ID tokenThe client names an algorithm the realm doesn’t offerOffer it in keySettings (step 1), or pick another
The app rejects the ID token’s signatureIt checks against a cached key set, or expects another algorithmRefresh its copy of the key set; match its expected alg
Setting RS256 is refusedThe client is held to FAPI 2.0Use ES256 or PS256

PATCH the client with { "idTokenSignedResponseAlg": null }. Its ID tokens go back to the default: RS256, or ES256 under FAPI 2.0.

  • No fallback. A client that names an algorithm the realm doesn’t offer gets no ID token: the sign-in fails.
  • FAPI 2.0 clients get ES256 by default, and may not use RS256. See Hold a client to FAPI 2.0.