Agave
Agave

Reputation: 21

Facebook debug_token only returns is_valid and app_id

I am trying to return the user_id in my app when calling https://graph.facebook.com/v2.2/debug_token

The Fields in the return data only returns is_valid and the app_id like this:

{
   "data": {
      "app_id": "338666432978837",
      "is_valid": true
   }
}

Is there a setting that I am missing in the App setup?

Upvotes: 0

Views: 684

Answers (2)

alexsanzdev
alexsanzdev

Reputation: 111

It seems like you are debugging your own app access token, this is the reason why you don't get any user specific info - because there is no user in this context.

In order to get user info such as the user's id, you need to debug the user access token:

GET /debug_token?
  input_token=THE_USER_TOKEN&
  access_token=YOUR_APP_TOKEN

input_token The user's token you want to debug.

access_token Your app's token. Required for request authentication.

Upvotes: 1

Tobi
Tobi

Reputation: 31489

Do you use

GET /debug_token?
 input_token={input-token}&
 access_token={access-token}

as described in https://developers.facebook.com/docs/facebook-login/access-tokens#debug

I was able to reproduce this behaviour if the input_token parameter is an app access token, so what kind of input_token are you using?

Upvotes: 0

Related Questions