Alex Kolarski
Alex Kolarski

Reputation: 3425

FB.Auth.setAuthResponse only compatible with OAuth2 issue

Loading my facebook page in a tab shows following error:

 FB.Auth.setAuthResponse only compatible with OAuth2.

I use oauth parameter like this:

FB.init({
    appId: fbAppId,
    status: true,
    cookie: true,
    xfbml: false,
    oauth: true
});

Am I doing something wrong ?

Upvotes: 5

Views: 3410

Answers (5)

Worthy7
Worthy7

Reputation: 1561

remove the parameters from your JDK including:

script src="http://connect.facebook.net/en_US/all.js"

Upvotes: 1

tevch
tevch

Reputation: 625

i had this error when using

ow.fbAsyncInit = function() {
    FB.init({
        appId   : '<s:property value="app_id" />',
        status  : true, // check login status
        cookie  : true, // enable cookies to allow the server to access the session
        xfbml   : true,  // parse XFBML
        oauth   : true
    });

Old variables i used:

response.session.access_token
response.session.uid

New variables helped:

response.authResponse.accessToken
response.authResponse.userId

Upvotes: 0

Ekrem
Ekrem

Reputation: 483

when using outh 2 add oauth=1 to provided js function for social plugins

<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) {return;}
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/tr_TR/all.js#**oauth=1**&xfbml=1&appId=164442023647373";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

Upvotes: 0

Andrew Cox
Andrew Cox

Reputation: 91

Some Facebook social plugins(the ones that require actually inserting JavaScript) have their own authentication scheme. The newly implemented Add To Timeline button is one example of a social plugin that will cause this error to appear in your JS console. Try removing social plugins and see if the error persists. If they disappear, your only real option is to switch to XFBML.

Upvotes: 0

jchar.mc
jchar.mc

Reputation: 1

  1. Log in to the Facebook account that is in charge of the App.
  2. Go to https://developers.facebook.com/apps/ and click on the App in question.
  3. In the left menu, under Settings, click Advanced and look at the settings in the Migrations section.

I encountered this issue on a test environment of mine, and switched the "Encrypted Access Token" setting to 'Enabled' and it seems to resolve the issue for me. I did all this code work for the migration but had NO IDEA that I had to go into the App and mess with settings.

HTH

Upvotes: 0

Related Questions