I have an Android application that provides users to use it by their Facebook accounts. For this purpose, I have integrated Facebook login. However, I confused about the user registration by Facebook.
When the user logged in, Facebook provides userId, email and access token. I can use them to create an account for the user at my back-end. Let's demonstrate the scenario:
User comes first,
1- User logged-in by Facebook.
2- The email is checked by server and returns no such user
3- An account is created by the information from Facebook
4- The user keeps using the app with this account.
User comes again,
1- User logged-in by Facebook.
2- The email is checked by the server and returns that there exists a user.
In right here, here are the questions:
1- How can the server trust the request that it is from really Facebook so the server can respond to the app "he can log in"? To be sure, should I verify the access token by connecting to Facebook at server side too?
2- If not, how can a user be registered by using the Facebook login in a very safe way?
A similar question has been asked here, but there is no answer as a solution.