Currently on our website we enable users to login/register with their Facebook credentials using graph api. We are creating a mobile app and we want to support login with Facebook as well. I know about the Facebook Android SDK and how to retrieve the access token, my question is:
- Once I have the facebook access token, how can I authenticate the user with our backend system.
One idea is to pass the access_token to my backend server and query for the user’s facebook id (I don’t want to pass the facebook id because someone can just spoof the request). Now using the facebook id I can then associate it with our user id and log the user in.
- Would this method work, or there’s another solution
The approach I described above works for well. Here’s the summary:
The controller that you are using will check for the fb param and query the user information
Sample of how the controller might look like