php - Facebook access token for site feed - Stack Overflow

I am trying to loading a facebook feed from my webpage using:For this I got an access token from the Gr

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 badges
Add a ment  | 

3 Answers 3

Reset to default 6

You 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

相关推荐

  • php - Facebook access token for site feed - Stack Overflow

    I am trying to loading a facebook feed from my webpage using:For this I got an access token from the Gr

    2天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信