0

我在用着

 FB.login(function(response) {
   if (response.authResponse) {
     console.log('Welcome!  Fetching your information.... ');
     var access_token =   FB.getAuthResponse()['accessToken'];
     window.location = "https://graph.facebook.com/me?"+access_token;
   }
 });

这将我重定向到以下结果:

{
  "error": {
  "message": "An active access token must be used to query information about the current user.",
  "type": "OAuthException",
  "code": 2500
  }
}

我在这里做错了什么?为什么我没有获得正确的访问令牌?

4

1 回答 1

1

您应该能够使用response.authResponse.accessToken.

此外,您需要将access_token变量附加到 Graph 请求: https://graph.facebook.com/me?access_token=YOUR_TOKEN

于 2012-09-12T12:08:45.347 回答