can't use facebook graph_api debug_token to debug users access_token

1.8k Views Asked by At

i used debug_token as in the documentation

'https://graph.facebook.com/oauth/debug_token?input_token='.$token_to_be_checked.'&access_token='.$app_access_token;

but it returned

{"error":{"message":"Missing redirect_uri parameter.","type":"OAuthException","code":191}}

although the redirect_uri is not mentioned in the documentation I added it to the previous request

.'&redirect_uri='.$my_url.'&client_id='.$app_id;

but still getting the following error

{"error":{"message":"Unknown OAuth 2.0 method, debug_token.","type":"OAuthException","code":1}}

would any body help me fix this issue and debug my token correctly

thanks in advance

1

There are 1 best solutions below

1
On

You are using the wrong endpoint.

You need to:

GET https://graph.facebook.com/debug_token

And you will only need these query parameters:

input_token: The token you wish to debug

access_token: Concatenation of your app's APP ID and APP SECRET with a pipe ('|'). So, if your app ID is '12345678', and your APP SECRET is 'jkg3ekjh453', your access_token would be: '12345678|jkg3ekjh453'

Hopefully this helps.