OIDC step-up authentication

Step up authentication is mechanism used by OIDC/SAML clients to require stronger authentication level based on a security policy defined by the client.

How does this work?

Let's assume you want to build a web application that allows users which are authenticated with a first factor, such as username and password or with a remote IDP (Facebook, Google, etc.), to view information about their account. When they want to perform an update of a specific attribute from their profile, for extra security measures, you want to challenge the user to authenticate with an extra factor, such as a push notification or an OTP.

A visualisation of an example can be seen below:

The above example can be translated to the following steps:

  1. User logs in with username and password
  2. Is redirected to a profile page where information about his/her account is available, such as phone number and email address
  3. User clicks change email address
  4. User is prompted with a screen where he/she has to enter a code which has been sent to their phone number
  5. Once the sms code is entered en successfully verified, the user enters its new email and updates it.

What APIs do you need?

For implementing the functionality described above, the authorize API is needed using the acr_values query parameter.

acr_values is an attribute which is defined by the OpenID Connect Specification , and specifies the level of authentication that is requested by the client application.

Assuming that the user is already logged in with username and password, once the user chooses to change his email, you would do the following request:

CURL
Copy

Since the user is not authenticated with a second factor, the response of the request will be a redirect to the login page with a special token:

Bash
Copy

OneWelcome will evaluate based on the requested ACR and the already used authentication methods, what's the best next option/s to authenticate the user with, and will show the user a screen with multiple options from where he/she can choose from. Once the user successfully authenticates with the second factor, the user will be redirected back to your application, with an id token having the requested acr claim, which indicates that the user achieved the requested level of authentication.

An example of id_token, with the acr claim can be seen below:

JSON
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated by Stein Welberg