I am trying to loading a facebook feed from my webpage using:
For this I got an access token from the Graph Explorer. The problem is that the token keeps running out:
Error validating access token: Session has expired at unix time ...
I know I could create a OAuth login to get a new token but I would like to show the feed on a webpage. I don't want to OAuth all visitors of the page. How do I get an constant access token for my site feed?
I am trying to loading a facebook feed from my webpage using:
https://graph.facebook./177610425663218/feed
For this I got an access token from the Graph Explorer. The problem is that the token keeps running out:
Error validating access token: Session has expired at unix time ...
I know I could create a OAuth login to get a new token but I would like to show the feed on a webpage. I don't want to OAuth all visitors of the page. How do I get an constant access token for my site feed?
Share Improve this question asked Mar 12, 2012 at 10:56 PiTheNumberPiTheNumber 23.6k17 gold badges113 silver badges189 bronze badges3 Answers
Reset to default 6You can easily get an access token. Just create an app and login using app_id
and app_secret
:
$response = file_get_contents('https://graph.facebook./oauth/access_token?type=client_cred&client_id=some_app_id&client_secret=the_appsecret');
$token = str_replace('access_token=', '', $response);
Works for me.
I don't think you can, it looks like they are deprecating the offline_access permission. Further down in the page it mentions extending the current token by 60 days. Perhaps that may help?
Check out my post from a couple of days ago (look at me Updated section in the original post).
Displaying Facebook posts to non-Facebook users
Because the offline_access permission is being deprecated, you're going to have to programmatically swap out your token periodically (which does not require reauthorization). Hope that helps.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744858290a4597540.html
评论列表(0条)