How to get Facebook user ID?

I followed this guide: http://developers.facebook.com/docs/authentication/ on how to set up Facebook authentication using php (server side implementation). I can get the access token from Facebook, but how do I get the Facebook user ID that is logged in?

+4
source share
2 answers

You must use the PHP version of facebook PHP: https://github.com/facebook/php-sdk/

See an example file so as not to get lost ... https://github.com/facebook/php-sdk/blob/master/examples/example.php

Facebook's graphical API is a little annoying ... so using this will be easier (at least for me)

+2
source

The easiest way if your framework / sdk / whatever does not provide it for you is to request https: //graph.facebook.com/me? Fields = id & access_token = ....

+2
source

Source: https://habr.com/ru/post/1344997/


All Articles