Auth0 Home Blog Docs

Linking multiple accounts flow

Hey Auth0,

I have some questions regarding account linking. I have been referring to the following guides:
https://auth0.com/docs/link-accounts/suggested-linking and https://auth0.com/docs/link-accounts/user-initiated-linking

To my understanding from the guides, two accounts existence is needed prior to the linking. So I am a bit confused with the authorization flow here. My user story flow is as below:

  1. User 1 sign up by using google (Login into the system)
  2. User 1 will link their Facebook account to the their existing account in Auth0.

As User 1 do not have any existing Facebook account in Auth0 yet, I assume I will need to create a new user to Auth0 that consist of the new Facebook identity. As far as I can tell from the POST /api/v2/users API and PATCH /api/v2/users/{id} API, I do not have the access to create/update the identities of User.

Which brings me to the conclusion, that I will need to:

  1. Logout User 1.
  2. Have User 1 sign up again but this time with a new social media as User 2. Save User 2’s uid somewhere
  3. Link them up by using the POST /api/v2/users/{id}/identities API
  4. Relogin as User 1

Am I missing some functionalities provided by Auth0 to link the identities programatically in a more straight forward manner?

I apologise if I am asking something obvious.

Thanks in advance!

1 Like

Hello @ztchia!

This is something that can be done by implementing a rule, or using our account linking extension.

Thank you!

1 Like