OAuth step-up needs both a challenge and a verified acr value
A service that exposes a sensitive operation may need stronger authentication than the one used to obtain the current access token. Sending a new password prompt is only part of the solution. The resource server has to state the requirement in a form the client can understand, and it has to validate the resulting authentication context before granting access.
RFC 9470 defines the OAuth 2.0 step-up challenge protocol. The resource server can return an insufficient_user_authentication error and include acr_values or max_age in the WWW-Authenticate header. A client should then ask the authorization server for an authentication event that meets those requirements.
A challenge that clients can parse
The RFC's example uses a bearer challenge with an authentication context class reference.
HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer error="insufficient_user_authentication", error_description="A different authentication level is required", acr_values="myACR" The acr_values parameter is a space-separated list in order of preference. max_age describes the allowable time since the last active authentication event. A resource server may use either or both. A challenge that names a requirement the client cannot request, or that is not advertised by the authorization server, leaves the user in a loop.
The authorization request should carry the requirement to the identity provider. The client then receives a new access token when the authorization server has completed an acceptable authentication event.
Validation is the gate
The resource server must inspect the authentication information associated with the new token. With JWT access tokens, acr and auth_time can convey the context and time of the user authentication. With introspection, the same values are returned in the introspection response. A token that merely contains a familiar acr string without a trusted issuer, signature, audience, and purpose check is not sufficient.
Test the boundary with a token whose acr is absent, a token with an unexpected value, an expired max_age window, and a token with a valid signature from the wrong issuer. The resource server should distinguish a missing claim from a failed policy and return a stable challenge without exposing internal policy details.
Refreshes do not reset auth_time
RFC 9470 says auth_time and acr are established at user-authentication time and do not change simply because an access token is renewed. A long-lived session can therefore keep a valid token while the authentication event grows older than the protected operation allows. That is the reason to check max_age at the resource in addition to the token's ordinary expiration.
Design a short list of context classes that the organization can explain and test. Examples may be password login, phishing-resistant authentication, or a managed-device session, but the names must map to real policy. Publish supported acr_values in authorization server metadata so clients can avoid impossible upgrades.
Audit step-up challenges, successful re-authentication, repeated challenges, and policy denials. If the authorization server returns a token after failing to meet the requested requirement, the resource server should reject it and the client should surface a clear policy error rather than retrying forever.
Step-up works when the challenge, the authorization request, the access token, and the resource policy describe the same authentication event. Each piece is necessary, and the final authorization check is the one that must fail closed.