Link User Identities Across Different Auth Methods

When you are building out your flows, you might have a user sign up with an email and verify their user account with an OTP text message to their phone. When this occurs, the user will still have to use their email address to sign up, as the phone number is not associated with their login ID by default (most commonly their email).

If you would like to verify and include their phone number as a login ID in one simple sign-up process for new users, this guide will show you how to do that. That way, a user can use their phone number the next time they log in, instead of just their email.

How to Implement with Flows

  1. Navigate to your flow, and open up the Action block list with the blue + in the top left corner

Descope multiple loginIDs guide configuring within flows step 1

  1. If you want to update a login ID with a phone number, select Update User / OTP / SMS and place it on the flow page. If you need to update a login ID with an email or something else, select Update User / OTP / Email, etc. This Update user block will give you the option to include whatever the user inputs as a verification method, in their Descope login ID.

Descope multiple loginIDs guide configuring within flows step 2

  1. Double-click on the first block (Update User) and select the checkbox Add to login IDs:

Descope multiple loginIDs guide configuring within flows step 3

Note

You can choose to replace all the user attributes from either the previous user created, or the new user created. Only the login IDs will be preserved between either option. The two options in this block will allow you to choose which one you would like to merge attributes with. This merging will only be used in case of a conflict in attributes, otherwise, you can ignore this.

  1. You can then include this as part of your main sign-up-or-in flow, with a user logging in via email, but then verifying themselves via SMS OTP and including both the phone number and the email address used to sign up as a valid login ID.

Descope multiple loginIDs guide configuring within flows step 4

As you can see in the picture, my flow prompts the user for an email, verifies the email with OTP, and then if it's a new user, it prompts the user to enter their phone number and updates their login ID to include their phone number as well (so that they can use it to log in afterward).

  1. And that's pretty much it! Now, under your sign-in flow (for only existing users) you can sign in with either email or phone number because both are part of the new user's login ID.

Descope multiple loginIDs guide configuring within flows step 5

You can see the phone number included as well if you head to the Users portal and check under the Login ID column:

Descope multiple loginIDs guide example of user with multiple loginIds

Without the Update User block, it would just include the user's email address.

As you can see, this is a really nice feature to include in your sign-up flow, to provide your users with a natural sign-up experience using both their email and phone number.

If you have any other questions about Descope or user login IDs, feel reach to reach out to us!

Was this helpful?

On this page