Make user pwd connection to the primary identity provider

When user sign ups a Google Auth, we will create a Pwd auth connection, then we will use management API to link Google auth connection with a Pwd Auth connection by linking them together.

When updating given_name and familly_name with the “Username-Password-Authentication” connection, we still received an error. The specified connection (Username-Password-Authentication) belongs to a secondary identity.

Can we instead make the “Username-Password-Authentication” the primary identity provider to avoid this problem? And how to do it?

[
  {
    "provider": "google-oauth2",
    "user_id": "107469007964388287664",
    "connection": "google-oauth2",
    "isSocial": true
  },
  {
    "profileData": {
      "email": "account@company.com",
      "email_verified": true,
      "last_password_reset": "2022-10-19T01:02:34.061Z"
    },
    "connection": "Username-Password-Authentication",
    "provider": "auth0",
    "user_id": "6348de7a58c1292a55d6fc59",
    "isSocial": false
  }
]

Hi @swifteam ,

I understand that you want to update the family_name and given_name of the “Username-Password-Authentication” connection for the linked account.

I tested this use case and noticed that after linking Google-oauth and DB accounts, the family_name and the given_name of the primary account are saved under the user profile. If Google auth is the primary account, we can not update both parameters under the “Username-Password-Authentication” connection.

However, if the “Username-Password-Authentication” connection is the primary account, we can update both parameters based on my testing.

Hope the above details are helpful! Please let me know if any further queries. Thanks!

@lihua.zhang Can we make “Username-Password” connection the primary through management API?

Yes, this can be done via the management API.

POST https://{{auth0_domain}}/api/v2/users/{primary_connection_user_id}/identities

sample body script

{
  "provider": "google-oauth2",
  "user_id": "google-oauth2|xxxxx"
}
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.