Php – Fatal error: Uncaught OAuthException: Invalid OAuth access token signature

facebook-graph-apifacebook-php-sdkjsonPHP

I have downloaded the php sdk for facebook, and am trying to retrieve a public pages statuses.

In my page I have the following:

require_once("facebook.php");
$config = array();
$config[‘appId’] = 'myID';
$config[‘secret’] = 'mySecret';
$config[‘fileUpload’] = false; // optional
$facebook = new Facebook($config);
$access_token = $facebook->getAccessToken();
$ret = $facebook->api(dogfishheadbeer, statuses);

//display messages
foreach ($ret->data as $m) {
        $name = $m->name;
        $message = $m->message;
        $time = $m->update_time;
        $id = $m->id;
        $page->content .= '<p> $message </p>';
}

The error I am receiving is:

Fatal error: Uncaught OAuthException: Invalid OAuth access token signature. thrown in /home/public_html/base_facebook.php on line 1254

Best Answer

You need to make sure that the $config[‘appId’] and the $config[‘secret’] are set. That's all. You will get those in your app settings in the developer area => http://developer.facebook.com

Related Topic