How to integrate the Next Identity Hosted Journeys profile workflow

Next Identity Hosted Journeys supports self-service account management with the profile screen.

In this journey, a user with an active session can visit the profile screen. On this screen an end user can update any allowed field. They can perform actions such as reset their password or choose the answers to security questions, if the configuration allows.

When the user calls Next Identity Journeys via the /personal-details endpoint, if the user already has an active session in the browser, the hosted service will display the personal details page. If the end user does not have an existing browser-based session, the login screen will be displayed to them before the personal details page is shown.

Endpoint URL

The profile request consists of the base domain + the endpoint (/personal-details) + parameters. Available parameters are listed below the example.

<https://id.eu.nextreason.com/personal-details>?  
client_id={{client_id}}  
&redirect_uri={{redirect_uri}}  
&response_type=code  
&state={{state}}  
&scope=openid  
&access_type=offline  
&nonce={{nonce}}

Required Parameters

The following parameters must be included on every request.

ParameterDescription
redirect_uriConfigures the URL the user is redirected after a successful authentication.

Important note: Ensure the URL is included in the list of allowed URLs for your integration. Contact your Next Reason consultant for assistance with adding URLs to the allowlist.
client_idThe ID used to authenticate the API call.
response_typeValue that determines the authorization processing flow to be used, including what parameters are returned from the endpoints. The only acceptable parameter is: code.
scopeOpenID Connect requests must contain the OpenID scope value. If the OpenID scope value is not present, the behavior is entirely unspecified. Other scope values may be present. Scope values used that are not understood by an implementation should be ignored. The "openid" default value will be used if no specific scope value is known.

Optional Parameters

The following parameters are optional.

ParameterDescription
promptSpace delimited, case sensitive list of ASCII string values that specifies whether the Authorization Server prompts the End-User for reauthentication and consent. The defined values are:

none
The Authorization Server must not display any authentication or consent user interface pages. An error is returned if a user is not already authenticated or the client does not have pre-configured consent for the requested claims or does not fulfill other conditions for processing the request. This can be used as a method to check for existing authentication and/or consent.

login
The Authorization Server should prompt the user for reauthentication. If it cannot reauthenticate the user, it must return an error, typically login_required.
stateThis state parameter is constructed by your application and included in the call to the hosted Next Identity service. It will remain unchanged and will be passed back to your application when the screen is redirected back. It is intended for use by your application to track user state. It should be an opaque value used to maintain state between the request and the callback.

Typically for applications, Cross-Site Request Forgery (CSRF, XSRF) mitigation is done by cryptographically binding the value of this parameter with a browser cookie. This value is required on every call, but the hosted service does not use this value in any way, it is solely for use by the application.

Doing so, the application can check and evaluate the value of the state parameter if it is correct or meets a specified criteria then perform expected actions or user journeys on the application-side.
access_typeThis parameter is used when making an authorization request. It is typically included as part of the URL parameters when redirecting the user to the authorization server. This parameter informs the authorization server about the type of access being requested. The most common values for access_type are:

online: The default value, indicating that the application requires access to the user's resources while they are actively using it. It doesn't prompt the user for re-approval of permissions each time they sign in.

offline: This value indicates that the application needs to access the user's resources even when the user is not actively using the application. When access_type=offline is used, the authorization server typically issues a refresh token in addition to the access token. The refresh token can be used to obtain new access tokens without requiring the user to re-authenticate.
nonceString value used to associate a client session with an ID token and to mitigate replay attacks. The value is passed through unmodified from the Authentication Request to the ID Token. Sufficient entropy must be present in the nonce values used to prevent attackers from guessing values.

Response Handling

In this journey, a user with an active session can visit the profile screen. On this screen an end user can update any allowed field. They can perform actions such as reset their password or choose the answers to security questions, if the configuration allows.

When the user calls Next Identity Journeys via the /personal-details endpoint, if the user already has an active session in the browser, the hosted service will display the personal details page. If the end user does not have an existing browser-based session, the login screen will be displayed to them before the personal details page is shown.

Configuration Options

The profile screen's menu can be customized according to your application's requirements. The following is capable of being displayed as menu options:

Menu ItemDescription
Change PasswordAllows the customer to change their password.
SecurityAllows the customer to enable or disable the following:

- Passwordless Authentication
- Two-Step Verification
- Change Security Question and Answer
Sign OutAllows the customer to end the session on their active device.
Sign Out of All DevicesAllows the customer to end the sessions across all devices with active sessions.

Error Handling

ErrorCodeCause
503Allows the customer to change their password.Incorrect client_id

Security Considerations

While the state parameter is not directly used within the profile endpoint itself, it plays a critical role in ensuring the secure handling of the authorization process that leads to accessing the profile endpoint.

Integration

  1. Redirect to Authorization Endpoint: Initiate the authentication request.
  2. Handle Redirect Back with Authorization Code: Capture and process the authorization response.
  3. Exchange Authorization Code for Tokens: Obtain access and possibly refresh tokens.
  4. Call Profile Endpoint: Direct a logged in user to the Profile screen using a URI similar to the following:
    https://id.eu.nextreason.com/personal-details?client_id=XXXXXXXXX&redirect_uri=XXXXXXX&response_type=code&scope=openid