Answer the question
In order to leave comments, you need to log in
How to securely authenticate users from Facebook?
Hello. How to properly authenticate users through social networks using Facebook as an example?
The logic seems to be simple. On the backend, it's just an API server with JWT. There is a users table and there is a table for social accounts, with the following structure:
where userId is a foreign key, and socialProviderId is the user id in the social network. Because in the system and users who enter as usual, through a login and password, and users logging in through social networks, then the registration procedure looks like this:
FB returns such an object from the login application:
{
"name":"имя и фамилия",
"email":"почта",
"picture": {
"data": {
"height":50,
"is_silhouette":false,
"url":"",
"width":50
}
},
"first_name":"имя",
"last_name":"фамилия",
"id":"id"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question