Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to merge internal and external accounts (facebook, twitter) if both have same email address using IdentityServer4 framework implementation

We built OAuth identity server using .net core with IdentityServer4 nuget package. We added support for facebook token support. So identity server will exchange facebook token with internal token using facebook graph API (https://graph.facebook.com/v2.8/me). Now we have requirement to merge two user if both have same email address.

Can you please suggest how to integrate this feature in our identity server? Is there any built in support or best practice to implement this?

like image 806
Mushthaque Ismail Avatar asked Mar 27 '19 04:03

Mushthaque Ismail


1 Answers

As per the identityserver documentation:

Our quickstart UI funnels all external authentication calls through a single callback (see ExternalLoginCallback on the AccountController class). This allows for a single point for post-processing. Federation Gateway Docs on Identityserver.io

So even if you're not using the QuickstartUI you can download it an inspect how are they configuring things to make the external authentication flow end on that controller and from there do all your checks (if there's a local user with same email) and associate the user with this "External Auth Record"

like image 135
Pablo Recalde Avatar answered Nov 15 '22 11:11

Pablo Recalde