質問

I am planning to come up with a website to access the profile information of my friends on Facebook. The first step being is to authenticate a friend with their facebook user name and password. I am reading up on the docs on manually authenticating a user. I am unable to understand that once I have a access_token, what steps I need to take to get a user information, in this case, even me?

What I also do not understand is the website states to provide the app_id and app_secret to generate the access_token. My understanding was that access_token would be needed for user. So where does the example code authenticate a user? I am guessing that I haven't understood the login flow properly. If there are any other references, please let me know.

役に立ちましたか?

解決

After getting the access token, simply use it with your calls. For eg:

$res = json_decode(file_get_contents(https://graph.facebook.com/me/friends?access_token=ACCESS_TOKEN));

EDIT

The token: APP_ID|APP_SECRET is the app access token, not the user access token; so it has nothing to do with the user and it wont understand /me. And its power is just.

The other token that is received by the login flow (as mentioned in the link you've mentioned in the question) is the user access token, and it understands /me. It has the power to do anything that user has granted the app to.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top