Facebook Application Auth Token Get Error

2019-06-02 05:44发布

I am trying to request the authtoken for my app via the Facebook API Graph Exlorer following the facebooks instructions. When I do a get call with a URL with the following form:

https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials

I get the following error:

 {
  "error": {
    "message": "Invalid callback",
    "type": "OAuthException",
    "code": 1
  }
}

Suggestions on how I might go about obtaining the access token for my app would be greatly appreciated!

If I try to obtain the access code programmatically running the following code:

 FB.api('/oauth/access_token?client_id={APP_ID}&client_secret={APP_SECRET}&grant_type=client_credentials', function(response) {
   alert(JSON.stringify(response));
  });

I get the following error:

{"error":"load-error: unknown"}

1条回答
ら.Afraid
2楼-- · 2019-06-02 06:10

You cannot execute this command using the Facebook Graph API explorer. Typing it directly into the browser returns the access token as desired.

查看更多
登录 后发表回答