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?