Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook API and access tokens

Alright, So I make an Graph API Call and parse the JSON request. Using a link like this I make a HttpGet request: http://graph.facebook.com/me/feed?=access_token="MYACCESSTOKEN"

This works fine, but the problem arises maintaining the same access token throughout.

So I registered an app through facebook and made another httpget request to

https://graph.facebook.com/oauth/access_token?client_id=_______&client_secret=_____&grant_type=client_credentials

using the client id and secret provided. This returned an access token. But I can't use this access token at all does let me into http://graph.facebook.com/me/feed?=access_token="MYACCESSTOKEN"

like image 994
Sriram Venkatesh Avatar asked Dec 12 '25 20:12

Sriram Venkatesh


1 Answers

The second request returns an APP access token https://developers.facebook.com/docs/howtos/login/login-as-app/

You need a user access token using one of the authentication flows https://developers.facebook.com/docs/howtos/login/server-side-login/

like image 105
phwd Avatar answered Dec 14 '25 08:12

phwd



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!