Answer the question
In order to leave comments, you need to log in
How to register and authorize a user on the site through the OAuth Vkontakte API, Facebook API and other social networks?
I'm sending the user to login to a third party site. I received a token, I request information about the user, for example, his ID and e-mail. For registration, I write this ID to the database with the flag of the social network where it came from, and for authorization, I request this ID with the flag and authorize.
I want that, no matter where the user comes from: Facebook, Vkontakte, Mail.ru or my own registration, they have one account.
Can you tell me if such a system is possible?
Do all social networks give me an e-mail (and if it is hidden by privacy settings)?
Answer the question
In order to leave comments, you need to log in
Some social networks give email, some do not.
It is best to use ready-made libraries if you do not really delve into the essence. For PHP, I recommend HybridAuth .
It all depends on how seriously you plan to deal with your resource. If you just need authorization, then perhaps it’s really better to use a third-party service.
If there are other improvements, then of course it is better to deal with the api once. Email does not give a tweeter and seems to be VKontakte. Plus, a user can have different mailboxes in different accounts.
In your case, it’s probably easier when a user logs in from any social network, just look in which browser he is still logged in and bring the accounts together.
If you do not want to delve deeply, use ulogin.ru/
Not all social. networks give the email address. mail, so it has to be requested additionally.
It has long been in a favorite post . No time to implement.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question