【问题标题】:I have a valid Facebook API Access Token, but it returns as Invalid/Non-Active: oAuthException我有一个有效的 Facebook API 访问令牌,但它返回为 Invalid/Non-Active: oAuthException
【发布时间】:2019-05-19 16:28:45
【问题描述】:

我发送了一个访问令牌,它在 Facebook 访问令牌调试器中是有效的,但它仍然说它不是活动的/是无效的访问令牌

我已尝试通过调试器放置访问令牌:出现为活动状态

var access_token = pathname.match(/\#(?:access_token)\=([\S\s]*?)\&/)[1];
$.ajax({
  url: "https://graph.facebook.com/me?name?access_token=" + access_token,
  type: 'GET',
  success: function(response) {
    console.log(response)
    //Would want to do stuff with the Return data
  },
  error: function(response) {
    $("#nameField").html("<li class='dataField' id='nameField'>The response could not locate the data source</li>")
  }
});

我希望它返回 JSON 数据/单个 JSON 条目。最终显示:

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

【问题讨论】:

    标签: javascript jquery facebook-graph-api oauth-2.0


    【解决方案1】:

    没关系,找到答案了:

    这是我使用的事实:

    https://graph.facebook.com/me?name?access_token=
    

    我应该在什么时候使用:

    https://graph.facebook.com/me?name&access_token=
    

    【讨论】:

      猜你喜欢
      • 2015-03-07
      • 2012-11-26
      • 1970-01-01
      • 2018-09-24
      • 2015-02-13
      • 2012-06-22
      • 2012-12-28
      • 1970-01-01
      • 2013-05-18
      相关资源
      最近更新 更多