Facebook access token for site feed

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?


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.com/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.


 ? facebook page access token
 ? Facebook Access Token - Comment as Site
 ? Facebook post with Page long acces token doesn't display
 ? Python: Check facebook user access token expired or not
 ? Python: Check facebook user access token expired or not
 ? Python: Check facebook user access token expired or not
 ? Python: Facebook API showing invalid token
 ? Facebook: How to get/update user access token using python?
 ? Python: best practice for a dynamic Facebook picture url with access token
 ? Python - Facebook Open Graph API Error: An active access token must be used to query information about the current user