0

Like widget works, Comment widget does not: SEE UPDATE 2


I inherited a project which has a Graph 1.0 implementation. Users can log in with Facebook, and then Like and Comment on the site.

The authentication system (symfony/php) interacts directly with Facebook in order to identify the user so that, if they don't exist, a profile can be created or, if they do exist, they can be logged into the local system as well.

The Like and Comment widgets have been updated to use the 2.0 syntax:

window.fbAsyncInit = function() {
        FB.init({
            appId      : 'KEY_HERE',
            xfbml      : true,
            version    : 'v2.3'
        });
    };
</script>
<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/es_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>

This seems to be working ok. Widgets are generated and, using my personal Facebook account, I can post and like and see the results on both this site and on Facebook.

Meanwhile, for authentication, the application generates an authorize url like this:

http://www.facebook.com/v2.3/dialog/oauth?client_id=API_KEY&redirect_uri=REDIRECT_URI&state=TOKEN&scope=SCOPE

Scope consists of the following:

'email', 'user_website', 'offline_access', 'status_update', 'publish_actions', 'publish_stream'

From the callback handler of that request, we retrieve the users Facebook profile and forward along to custom code for logging a user in, or registering them:

https://graph.facebook.com/v2.3/oauth/access_token?client_id=API_KEY&redirect_uri=REDIRECT_URI&client_secret=API_SECRET&code=CODE

This also appears to be working, as long as I'm using my personal FB profile. I can login and Comment and Like things.

When I log in using my Open Graph Test User, I can't Like or Comment. When try to post a comment, I get an error which simply states "Oops" in a lightbox/dialog. From my console, I get the following error:

for (;;);{"__ar":1,"error":1357010,"errorSummary":"Oops","errorDescription":"Something went wrong. We're working on getting it fixed as soon as we can.","payload":null,"bootloadable":{},"ixData":{},"lid":"0"}

Here's what appears to be a comprehensive list of error codes, but 1357010 is not listed:

[http://fbdevwiki.com/wiki/Error_codes][1]

So, the fundamental question is, why can my Open Graph Test User (configured to run the app in 2.0 mode) not interact with the widgets, while my personal FB profile can? Have I failed to properly upgrade the authentication system so that the 2.0 Test User isn't sufficiently privileged?

[UPDATE]

When my application logs a user in, there is no part of the FB dialog which permits a user to accept the permissions which are being requested. Regardless of whether I'm logged in with my personal account or the Graph Test User, I can Like a page and then, subsequently, Comment from the resulting dialog - that dialog requests permission to do so.

But, from the standard Comments widget, I'm never asked to grant permission to post - it just fails with error 1357010. Toggling on/off "Also post on Facebook" makes no difference.

Am I not authenticating in a 2.0 fashion?

[UPDATE 2]

It looks like my Open Graph Test User can Like a page, and then, after confirming, the user can Comment on the page form the resulting dialog from the Like widget.

However, from a Comment widget, the comment is not successful and I get the generic error code 1357010.

What do I need to do to authorize my OG Test User (v2.3 user) to submit comments from a standard Comments widget?

Carlos Mossman
  • 45
  • 1
  • 10
  • offline_access and publish_stream permissions don't exists anymore. Try to make the same request in Graph Explorer with the same access token – WizKid Apr 20 '15 at 19:24
  • thanks for the suggestion, @WizKid. I pasted an access token from my Test User in Graph Explorer. I get a valid response containing the following fields: `id, first_name, last_name, email, picture, link`. And after trimming my permissions to just `email, publish_actions, user_website`, I still get the same error, with code: `1357010` – Carlos Mossman Apr 20 '15 at 19:43

1 Answers1

0

It's unclear what are the calls you are making and I believe by "Like and Comment Widgets" you are talking about custom ones that are powered by the API and not the official Facebook plugins.

So to the issue: test users CANNOT interact with real data as per the docs:

  • Each app can create a maximum of 2000 test users.
  • Test users can only interact with other test users, and not with real users on Facebook.com.
  • Test users cannot become a fan of a public Facebook Page or create content on them, such as writing on a Page's wall. A Test user can however view and interact with any app tab on the Page associated with the app that created them.
  • Test users are unable to reply to messages, even if the message was created by the test user.
  • Test accounts can only be accessed and used by any developer of the associated app.
  • Test users will only have 'Tester' privileges on the associated app. This means that they can use the app in Public Mode or Development Mode, but cannot edit any technical settings or access insights for that app.
  • Test accounts cannot be converted to normal user accounts.

If you are interacting with real data, this may not work. You could probably test this by creating a new test user and observe the results.

ifaour
  • 38,035
  • 12
  • 72
  • 79
  • Thanks @ifaour. Regarding whether these are custom widgets vs. official Facebook plugins, I believe they are official - nothing custom. I insert something like: `
    ` and then FB converts it. And, regarding "real data", when my test user posts, I see the comment display momentarily, and then it's removed. Is this because the Test User was interacting with "real data" and it got inserted into the UI, rejected on the server, and then subsequently removed?
    – Carlos Mossman Apr 24 '15 at 19:02
  • I don't know the exact behavior on top of my head. But I would assume that a similar logic will apply where "app test-accounts" won't be able to interact with real data (your website) in the way you are trying. – ifaour Apr 28 '15 at 13:54