question

NHering22101 avatar image
1 Vote"
NHering22101 asked Krishan-3347 commented

Connect social account to existing signed up user (B2C)

I have been using in B2C a user flow, in which the user can sign up either by using local sign up (email & password) or social (eg. gmail). When I run the following scenario
1. Open app and sign up with email-password, using myemail@something.com
2. In B2C I can see the myemail@something.com created
3. Open app and sign up with social (eg. gmail account myemail@something.com)
4. In B2C I can see another user created, with this gmail account.

However, what I want is to be able to connect these 2 accounts. In other words, whenever a user signs up with a social, I want to hook up a logic to see whether a user with this email already exists and connect it. As an extension to this scenario, I want to have a "connect" option once the user is signed in the app (eg. when user signed in with the local account, I want to be able to make a custom call to B2C to connect a new social account to a specific user).

Is this possible?



azure-ad-b2c
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @NHering22101 , so are users signing up twice, once using their personal email and another time using something like Facebook? Is this by design or just seems to happen accidentally? And then from there you want to connect them to the same account?

Best,
James

0 Votes 0 ·

@JamesHamil-MSFT it will not happen accidentally. I will rephrase my example: lets say i have a user who has signed up with local email password. Then, while being singed in he wants to connect his social account (eg. gmail). So in my application I want to expose a "connect" button which will be able to make an auth call to the external idp and in the callback in case of success associate that "social user" with the existing. Once this is done, the user can sign out and in the next sign in he can either sign in with local or with social - both ways will result into the same User ID.

Hope it becomes more clear what I want to achieve.

0 Votes 0 ·

1 Answer

NHering22101 avatar image
1 Vote"
NHering22101 answered Krishan-3347 commented

@JamesHamil-MSFT any update on this? Thanks

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @NHering22101, Somewhat similar issue is described here: https://stackoverflow.com/questions/59867036/how-to-check-user-exists-in-ad-b2c-using-custom-policy

Hopefully, this helps to formulate your custom policy accordingly.

0 Votes 0 ·

Im having the same issue, but im not using a custom policy... im using the basic sign-in/up user flow, and to my surprise now I have 2 users with the same email...

isn't this (connect account to social providers) a OOTB feature?

0 Votes 0 ·

Hi @NHering22101 and @JamesHamil-MSFT I am also having similar requirement, however we don't want Local login option, only social login(Google/Facebook). And allow users to link their account if similar email address used for Google or Facebook. Please let me know how I can achieve this. I am also using predefined user flow for SingIn and SignUp. Thanks!

0 Votes 0 ·