Will Facebook SDK 3.1.x display authentication page?

Go To StackoverFlow.com


I am doing a Canvas app inside the facebook page.

My very simple question is this: With the newest facebook SDK (just downloaded today), if a user has not yet granted access permission to your app, will the facebook class within the SDK automatically determine that and attempt to get authorization?

I can manually get auth for my app by going here:


That all works just fine... but when I attempt to do what the example.php does in the SDK, it returns an error:

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

Thus my question is: Am I supposed to be getting a valid OAuth access token, or am I setting up the facebook PHP SDK wrong?

Here is my complete PHP code that generates the error:

require 'facebook.php';

$facebook = new Facebook(array(
'app_id' => '<my app id>',
'app_secret' => '<my app secret>',

$user = $facebook->getUser();

$jared = $facebook->api('/jaredmark');

if ($user) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
$user = null;

// Login or logout url will be needed depending on current user state.
if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();

This code is essentially a direct copy/paste from the example, with a few minor edits.

2012-04-04 17:05
by Jared Mark
I guess no one knows - Jared Mark 2012-04-05 14:19


It doesn't seem to be the case that the PHP SDK will display an authentication pop up without you manually causing it to do so by redirecting to that specific page. sigh

2012-04-06 21:03
by Jared Mark