# Make user pwd connection to the primary identity provider

**URL:** <https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825>\
**Category:** Get Help\
**Created:** [November 6, 2022, 11:41pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825 "2022-11-06T23:41:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swifteam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/swifteam/32/33281_2.png) [@swifteam](https://community.auth0.com/u/swifteam)\
**Post date:** [November 6, 2022, 11:41pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825/1 "2022-11-06T23:41:13Z")

</div>

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](https://community.auth0.com/t/notify-user-that-he-previously-uses-social-login/87316/2).

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?

```auto
[
  {
    "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
  }
]

```

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [November 7, 2022, 9:48pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825/3 "2022-11-07T21:48:26Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![swifteam](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/swifteam/32/33281_2.png) [@swifteam](https://community.auth0.com/u/swifteam)\
**Post date:** [November 7, 2022, 10:43pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825/4 "2022-11-07T22:43:04Z")

</div>

> [@lihua.zhang](#):
>
> However, if the “Username-Password-Authentication” connection is the primary account, we can update both parameters based on my testing.

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

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [November 7, 2022, 11:30pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825/5 "2022-11-07T23:30:29Z")

</div>

Yes, this can be done via the [management API.](https://auth0.com/docs/api/management/v2#!/Users/post_identities)

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

sample body script

```auto
{
  "provider": "google-oauth2",
  "user_id": "google-oauth2|xxxxx"
}

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 21, 2022, 11:31pm UTC](https://community.auth0.com/t/make-user-pwd-connection-to-the-primary-identity-provider/93825/6 "2022-11-21T23:31:12Z")

</div>

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