How to Update the User Profile Details of the Linked Accounts

Problem statement:

Auth0 supports the linking of user accounts from various identity providers. This allows a user to authenticate from any of their accounts and still be recognized by your app and associated with the same user profile.

How can we update the User profile details, such as password, for either the primary or the secondary account?

Solution:

To do this we need to make a call to PATCH ‘/api/v2/users/{primary account id}’ endpoint, and in this connection we need to specify the connection type to identify if the change is for the Primary or the Secondary account.

For example, if the primary is google-oauth2, and the secondary is Username-Password-Authentication,

To update the password of the primary account, this is the body script:

{
"connection": "google-oauth2",
"password": "Passw0rd!"
}

To update the password of the secondary account, this is the body script:

{
"connection": "Username-Password-Authentication",
"password": "Passw0rd!"
}

Reference: