What causes "requires valid signature" error when calling FQL from javascript SDK?
My site uses FQL called from javascript as such:
FB.api({
method: 'fql.query',
query: 'SELECT uid, name, first_name, pic_big, pic, third_party_id from user where uid in (SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY name'
},
function(response) {
if( response.error_msg ) {
alert("Sorry! Something went wrong loading your Facebook friends:"+response.error_msg);
return;
}
process_friends(response);
});
}
They get here after a normal FB.login()
call. This is working fine for most users. But some users (or user sessions at least) consistently get the "requires valid signature" error and can't get past this, even after FB.login()
'ing in again.
What does that error really mean? I'm guessing the oauth token is invalid? But the token came from within the javascript SDK -- I never touch开发者_高级运维ed it, and didn't make the signature. Could the user be in an inconsistent login state? Insufficient app privileges? Some strange cookie setting?
It does mean that you need a valid access token.
EDIT: A better link to the documentation: https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/
精彩评论