Facebook Application Auth Token Get Error

陌路散爱 提交于 2020-01-03 02:57:09

问题


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:


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



来源:https://stackoverflow.com/questions/10508368/facebook-application-auth-token-get-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!