What causes the "requires a valid signature" error when calling FQL from the 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 appear here after the usual call to FB.login() . This is normal for most users. But some users (or at least user sessions), as a rule, get the error "requires a valid signature" and cannot pass by, even after FB.login() "log in again".

What does this error mean? I assume oauth token is invalid? But the token came from the javascript SDK - I never touched it and did not make a signature. Can a user be in an inconsistent login state? Not enough app privileges? Some weird cookie settings?

+4
source share
1 answer

This means that you need a valid access token.

EDIT: Best documentation link: https://developers.facebook.com/docs/concepts/login/access-tokens-and-types/

+5
source

Source: https://habr.com/ru/post/1346785/


All Articles