Home > OS >  Facebook Graph API /debug_token empty response
Facebook Graph API /debug_token empty response

Time:01-31

I am using Facebook's PHP SDK (because it still works, even though it's deprecated, and there's no proper PHP alternative in place), and I've somewhat recently received messages from Facebook about my login app being deactivated because it "has too many errors". I decided to debug it and find out what seemed to be the problem, and it turned out that at the /debug_token step it receives an empty response from Facebook, which is, of course, invalid.

According to https://developers.facebook.com/docs/graph-api/reference/v15.0/debug_token, this API endpoint should return information about an access token that I received from /oauth/access_token. I tried requesting for this debug information in Facebook's own Graph API Explorer, but the response I got was {"data":[]}. There were various errors if I provided the wrong data, so I would assume if the access token was wrong, I would have also received an error, but nope.

Commenting out the bit of code that does the access token debugging/validation fixes the whole thing, but that hardly seems like the right fix, although it counts for the end users.

The PHP SDK github repo is archived, I can't ask questions here, so I have no other choice but to ask here - 1) does anyone know if the debug_token step is required, and if yes, then 2) for what reasons, and 3) what could possibly be the problem here? At the moment it absolutely seems that the fault is at Facebook's end, I went through all the server requests and all of them work except this one.

CodePudding user response:

I got the same issue about empty array from /debug_token endpoint. After investigations, it seems to be only on development applications. With live applications, /debug_token returns data ... Another weird behaviour from Facebook Graph API

  • Related