简体   繁体   中英

Handling Multiple Social Login/Registration System

First let me clarify what am not asking. Am not asking how to do the Registration/Login itself. I can use OAuth with Twitter and FB for example, to register single user.

Now what am asking: I have user table and socials table which holds user registration. When user tries to register with his social network, we also present a form for his "user" table information (Like birth-date) and then log him immediately. So far so good! Now Suppose user logs out and somehow this time logs in with Twitter . How should I connect the "user" table data since I have no idea its the same user already have registered?

I could use email, but some people have different email for Facebook and Twitter Account. In that case I will have duplicate profiles in "user" table. I know I can tell user to login and associate his social account with his twitter or create new profile. But am trying to check if there is anything I can do to associate user Twitter profile with same data in "user" table that user filled in when he used facebook

I would save all login data in the same user table. Force the user to actually connect the accounts they want to log in with. Then save the e-mail you get from each service and save it to the corresponding service column in DB.

E-mail is the only unique common thing about these accounts. I think this is the only way to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM