I'm using parse-server (on heroku) as the backend for a mobile app.
Facebook login/signup will be an option for users.
What's the best workflow?
Is there a module where I can plug in the auth token and ping FB for the profile picture, DOB, or whatever else I need?
Any insight and sample code would be MUCH appreciated.
Thanks!
I have been using the facebook APIs for social login in my App, i used the first approach you mention i.e.
I was thinking the mobile client could login to FB and pass the token to the express app. The express app could grab the data we need from FB and create/login the Parse user.
I use two FB APIs, one for authenticating the app and the other for authenticating the user.
The mobile client fetch the acces token form facebook and passes to the backend express APP. the two APIs used are:-
For authenticating the App
https://graph.facebook.com/app/?access_token=
For authenticating the user
https://graph.facebook.com/me?fields=id,email,name,gender,picture&access_token="
p.s. you can select the parameter like name or email according to your need.
For authenticating the app, when you hit the API, you will get a json containing the FB_APP_id, which is unique and can be compared with the one provided by fb while you create your project on fb.
So far this approach is ok as my app is live and working fine.