Skip to main content

Profile update

Profile update allows users to securely update their own profile information, such as their name, email address, or mobile number. The user verifies their identity through a secure method, such as an email or SMS code, before updating the profile.

In the Flow Builder, you can create the profile update journey in two ways:

  • Use a starter template – Load a ready-made flow and customize it to your needs.
  • Build from scratch – Take full control by designing every step yourself.

Sample use case​

Imagine a user is signed in to your application and wants to update their profile. You want to verify the user's identity via Email OTP before allowing them to make the change. The flow works as follows:

  1. The application starts the flow with the ID token of the signed-in user, using the Flow Execution API.
  2. WSO2 Identity Platform identifies the user from the ID token and returns a one-time link to the profile management page.
  3. The application opens the link in the browser.
  4. WSO2 Identity Platform sends a one-time code to the user's registered email address.
  5. The user verifies their identity by entering the code.
  6. The user updates the profile.

This ensures that only the signed-in user with access to the registered email address can update the profile, enhancing security.

Profile update flow

Build the flow​

To build the sample use case, start from the Profile Update with Email OTP template and adjust it.

Follow the steps below to configure this flow.

Step 1 - Load the template​

To load the template:

  1. On the WSO2 Identity Platform console, navigate to Flows.
  2. Click on the Profile Update card.
  3. Click the + button next to the Profile Update with Email OTP template to load it onto the canvas.
Step 1

Step 2 - Add the attributes to update​

By default, the form in the Update Profile step doesn't contain any input fields. Add the attributes that users are allowed to update.

  1. From the Components panel, drag and drop a field component, such as Text Input, onto the form in the Update Profile step.
  2. Click the pencil icon on the field and, from the Attribute dropdown, select the attribute it updates (for example, First Name). Then update the Label and Placeholder of the field to match the attribute.
  3. Repeat for each attribute that users are allowed to update.
Step 2

Step 3 - Configure the flow completion​

The End node determines what the user experiences after successfully updating the profile.

  1. Click on the green End node on the canvas (labeled "Profile Updated Successfully").
  2. With the End node selected, click the gear icon (⚙️) on the top-right to open the Flow Completion Properties.
  3. (Optional) Enable Send a notification email on flow completion to notify the user that their profile has been updated.
  4. Click Save Draft to keep your progress.

Step 4 - Enable the flow​

Once the flow has been fully configured and is ready for users:

  1. On the top-right corner of the Flow Builder, turn the toggle ON to publish the flow.

Now that these changes are in place, you have built a secure and user-friendly profile update flow using Email OTP.

Start the flow from your application​

The Verify Signed-in User step identifies the user from the ID token that your application holds. To accept the ID token, WSO2 Identity Platform requires the urn:wso2:identity:flow:user-verification audience in it.

To start the flow from your application:

  1. On the WSO2 Identity Platform Console, go to Applications and select your application.

  2. In the Protocol tab, under ID Token, add urn:wso2:identity:flow:user-verification as an audience and click Update.

  3. Once the user signs in, call the Flow Execution API with the user's ID token.

    curl --location '{{ api_base_path }}/api/server/v1/flow/execute' \
    --header 'Content-Type: application/json' \
    --data '{
    "flowType": "PROFILE_UPDATE",
    "applicationId": "<application_id>",
    "inputs": {
    "token": "<id_token>",
    "tokenType": "urn:ietf:params:oauth:token-type:id_token"
    }
    }'
  1. The Continue Elsewhere step returns a REDIRECTION type response. Open the link in data.redirectURL in the browser, where the user continues the flow.

    {
    "flowId": "a4bb2b9f-cfe3-46a0-915c-ef01c1108d6e",
    "flowType": "PROFILE_UPDATE",
    "flowStatus": "INCOMPLETE",
    "type": "REDIRECTION",
    "data": {
    "redirectURL": "https://accounts.asgardeo.io/t/<organization_name>/accounts/manage-profile?flowId=6e032875-27e4-4310-9da1-3acc43a27262&handoff=true",
    "additionalData": {
    "handoff": "true"
    }
    }
    }
note

The ID token must be issued within the Maximum token age of the Verify Signed-in User step, and the link is valid only once, within the time set in the Continue Elsewhere step. See Verify signed-in user properties and Continue elsewhere properties.

Start the flow without a token​

Instead of the Verify Signed-in User step, you can start the flow with a User Resolve View, where the user enters the username. With a User Resolve View, the flow must have at least one verification step after it, such as an Email OTP View, SMS OTP View, or Magic Link View.

Reference​

This section provides details on the configuration options available in the Profile Update flow.

Verify signed-in user properties​

The Verify Signed-in User step identifies the user from the ID token that the application sends when it starts the flow.

  • Maximum token age: Set the duration (in minutes) within which the ID token must have been issued. The default value is 5 minutes.

Continue elsewhere properties​

The Continue Elsewhere step returns a one-time link, so that the user continues the flow in the browser.

  • Continue at: The page the link points to, where the flow continues. Leave it empty to use the default profile management page of WSO2 Identity Platform.
  • Link valid for: Set the duration (in seconds) for which the link is valid. The default value is 60 seconds.

Flow completion properties​

The Flow Completion Properties, configured on the End node, define the final actions that occur after a user successfully updates the profile.

  • Send a notification email on flow completion: When enabled, the user will receive an email confirming that their profile has been updated successfully.

Was this page helpful?