Skip to content
Workforce IdentityMarkdown

Step-up and re-authentication

Ask for a stronger or more recent sign-in before a sensitive action, and see in the token what the user proved.

AvailableAPIOpenID Connect Core 1.0 §3.1.2.1, RFC 8176, RFC 9470

Some actions need more than “signed in”: a payment, a change to security settings, reading a secret. With step-up, an app or an API asks for a stronger or a more recent sign-in, and the realm sends the user through the sign-in chain that earns it. The user’s session carries on, stronger or fresher, and one sign-out still ends everything granted before and after.

An app can ask for three things:

  • How strongly (acr_values). You name levels, such as urn:example:acr:mfa, and tell the realm which sign-in chain earns each one. A user who signed in with less is sent through the stronger chain.
  • How recently (max_age, prompt=login). A user whose sign-in is too old signs in again.
  • Who (id_token_hint). Only the named user may answer.

Tokens record the outcome: acr names the level reached, amr the methods used (such as pwd, otp), and auth_time when.

  • Who can do it: a realm administrator (a group holding RealmOwner) names the levels and builds the chains; RealmViewer can read them. The app asks for a level on each sign-in.
  • Where: today this is done through the API (Call the API shows how to get $CVYUH_SESSION).
  • First: a chain that earns the level, such as a password and an authenticator app (Sign-in chains).

An API behind the gateway can demand a level or an age in its policy. The app then steps up:

1. The API refuses the token. The gateway answers 401 with a challenge that names what the policy needs:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="insufficient_user_authentication",
acr_values="urn:example:acr:mfa", max_age=300,
resource_metadata="https://api.example.com/.well-known/oauth-protected-resource"

2. The app sends the user back to sign in, passing on what the challenge named, in an ordinary browser sign-in:

GET /oauth2/authorize?response_type=code&client_id=team-wiki
&redirect_uri=https%3A%2F%2Fwiki.example.com%2Fcallback&scope=openid
&acr_values=urn%3Aexample%3Aacr%3Amfa&max_age=300
&state=k2j3h4&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256
Host: foobar.cvyuh.com

3. The app retries the call. If the user’s session already holds that level and is recent enough, they aren’t asked to sign in again. If not, they sign in through the stronger chain. The new tokens carry acr: "urn:example:acr:mfa".

Set the levels on the realm with PATCH https://foobar.cvyuh.com/api/v0/am/objects/v1/oauth2Settings/oauth2Settings (see Call the API):

WhereSettingWhat it does
RealmacrValuesEach level’s name, mapped to the chain that earns it (empty by default). Discovery lists the names as acr_values_supported
RealmamrValuesEach sign-in module, mapped to the amr value it adds (empty by default)
Realman authChain objectThe stronger chain itself

The realm’s sign-in pages for only the steps the stronger chain adds: a user already signed in with a password is asked for their authenticator code or passkey, not the password again. For max_age or prompt=login, they sign in again. Then the browser returns to the app. If they can’t complete the step, the app is told access_denied.

Setting or limitDefaultRange
acrValuesnonelevel names mapped to chains
amrValuesnonemodule names mapped to amr values
Step-up attempts per requestonefixed
max_agenonea whole number of seconds, zero or more
SymptomCauseFix
The token’s acr isn’t the level asked forThe realm doesn’t know the value, so it was ignoredAdd it to acrValues, and have the app check acr
access_denied after a re-sign-inThe chain didn’t earn the level, or the session records no chainCheck the chain the level names; the user signs out and in again
login_required with prompt=noneStep-up needs the user presentSend the request without prompt=none

A step-up that continues the session writes SESSION_UPGRADED (the session keeps its sid), beside the sign-in’s LOGIN and its steps; the new tokens are a TOKEN_ISSUED record naming the acr reached. See them in Audit → Authentication.

  • Levels match exactly. There is no ranking, so the app lists every value it accepts.
  • A value the realm doesn’t know is ignored. The app must check the acr it receives.
  • A step-up is tried once per request. If the chain still doesn’t earn the level, the answer is access_denied.
  • prompt=none never steps up. It answers login_required.
  • max_age is a whole number of seconds, zero or more.
  • An id_token_hint must be an ID token this realm issued to the same app. Its expiry doesn’t matter, since it only says who the app expects.
  • A session that records no sign-in chain can’t sign in again through one. max_age or prompt=login on such a session is answered access_denied.

These go back to the app’s return address, as any sign-in error does.

ErrorWhen
access_deniedThe step-up didn’t reach the level asked for, or the session records no chain to sign in again through
login_requiredprompt=none and the user would have to sign in; or the user signed in isn’t the one id_token_hint names
invalid_requestid_token_hint isn’t an ID token this realm issued to the app, or max_age isn’t a whole number