php - Handling Multiple Social Login/Registration System

243

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

188

Answer

Solution:

I would save all login data in the sameuser 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.

People are also looking for solutions to the problem: mysql - Why phpmyadmin doesn't notice me that it reaches the maxmium php execution time?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.