Skip to content
Workforce IdentityMarkdown

Step up for sensitive actions

Ask a signed-in user for a stronger sign-in, such as a one-time code, before a payment or an admin change, and let the app and API see that they gave it.

Dashboard and APIOpenID Connect Core 1.0, RFC 9470

Users sign in to your app with a light sign-in for everyday use. When they reach a sensitive action, such as approving a payment, changing an email address or deleting an account, the app asks the realm for a stronger level by name. The realm takes them through a stronger sign-in, such as a password plus a one-time code, and the new tokens say which level they reached.

The level is an acr value: a name you choose, such as urn:example:acr:mfa. You tell the realm which sign-in chain earns each name (see Sign-in chains).

Before you start:

  • Who can do it: a realm administrator, in a group that holds RealmOwner (Delegated administration).
  • Where: step 1 in the dashboard, Authentication → Settings, or the API; steps 2 and 3 through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: this guide is for a realm whose everyday chain is lighter than the one it was born with (a passkey, or a password then an authenticator code, universalLogin), such as a password alone (nativeStoreChain). Users need an authenticator app set up to pass the stronger chain.
  1. Make sure the second factor is offered. A realm is born with totp in its authenticators and a totp module instance. If yours lacks it, add it in Authentication → Settings to the recognized modules. In the API, read the list with GET https://foobar.cvyuh.com/api/v0/am/objects/v1/authSettings/authSettings, then send it back with totp added:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/authSettings/authSettings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "authenticators": ["…existing modules", "totp"] }'

    The list you send replaces the realm’s whole list: a module you leave out can no longer run.

  2. Create the stronger chain: a password, then a one-time code from an authenticator app.

    Terminal window
    curl 'https://foobar.cvyuh.com/api/v0/am/objects/v1/authChain?id=mfa' \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{ "chain": [
    { "module": "nativeStore", "flag": "REQUIRED" },
    { "module": "totp", "flag": "REQUIRED" }
    ] }'
  3. Name the levels, and the methods each module adds. The everyday chain earns pwd, the new chain earns mfa:

    Terminal window
    curl -X PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings \
    -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
    -H "Content-Type: application/json" \
    -d '{
    "acrValues": { "urn:example:acr:pwd": "<your everyday chain>",
    "urn:example:acr:mfa": "mfa" },
    "amrValues": { "nativeStore": "pwd", "totp": "otp" }
    }'
  4. Tell app developers the level’s name. For the sensitive action, the app sends a normal sign-in request with acr_values=urn:example:acr:mfa.

The user clicks Approve payment. The realm takes them through the stronger chain (their password, then their authenticator code), and they’re back in the app with the payment going through. Their session continues: it is the same session, now stronger, and one sign-out still ends everything from before and after the step-up.

The new ID token and access token carry acr: urn:example:acr:mfa, and amr lists the methods used (for example pwd and otp), if you map them.

At an API behind the gateway, a policy can require a stronger level. The gateway then answers 401 with error="insufficient_user_authentication" and the acr_values or max_age it needs, and the app starts a step-up with exactly that.

Send a sign-in with acr_values=urn:example:acr:mfa as a signed-in test user. You should be asked for the code, and the ID token’s acr should be urn:example:acr:mfa.

The step-up is on the user’s trail as a SESSION_UPGRADED record, then a LOGIN record whose steps show the password and the code. A wrong code is a LOGIN_FAILED record, and counts toward Lockout. Find them in Audit → Authentication in the dashboard.

SymptomCauseFix
The user signs in as usual and acr is the everyday valueThe app asked for a value not in acrValues, which is ignoredAsk for the exact name; have the app check the acr it gets back
The user is asked for a code they never set upThey have no authenticator app yetThey set one up when the chain asks; see Sign-in methods
Saving the chain is refusedA module it names doesn’t exist in the realmCheck the realm has a totp module instance (step 1)
login_requiredThe request carried prompt=noneDrop prompt=none for a step-up

Remove the level by sending its key as null in acrValues: { "acrValues": { "urn:example:acr:mfa": null } }. Apps that ask for it then sign users in as usual.