I’m developing an app with Ionic 3 and Angular 4, and also implementing Login With Facebook button (and logic).
I don’t understand how to secure this process.
The API returns the user’s email + id and then I need to send them to my server to register / log in the user.
But how can I be sure that nobody “fake” the ajax call with those user email & id? And skip the whole Facebook Button process?
I don’t get it at all – no matter what the API returns – I need to send it to the server via AJAX, and anyone can fake this process and send specific parameters with AJAX.
Question posted in Facebook API
The official documentation for the Facebook APIs can be found here.
The official documentation for the Facebook APIs can be found here.
2
Answers
A good way is to send the Access Token to the server and make the API call to the Facebook API there. You can/should activate “Require App Secret” in the App settings:
The answer is – backend!
You should always verify the token in the server side to prevent "hacks" like you said