S
S
Salvador20062013-01-15 16:04:26
Social media
Salvador2006, 2013-01-15 16:04:26

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

6 answer(s)
N
Nazar Mokrinsky, 2013-01-15
@Salvador2006

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 .

A
Alex10, 2013-01-18
@Alex10

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.

C
CoDe_reD, 2013-01-15
@CoDe_reD

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.

S
Salvador2006, 2013-01-15
@Salvador2006

Thank you. I will use.

X
xaker1, 2013-01-15
@xaker1

It's best not to focus on email, f bc

S
Sergey Krivochenko, 2013-01-16
@krivochenko

It has long been in a favorite post . No time to implement.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question