Facebook访问令牌为用户搜索提供错误代码190和错误子代码463

时间:2015-03-02 13:55:42

标签: wcf facebook-graph-api facebook-access-token wcf-rest

我正在尝试使用WCF服务为facebook url制作HttpWebRequest。它在WCF中给出了错误的请求错误:

https://graph.facebook.com/search?type=user&access_token=" + Convert.ToString(ConfigurationManager.AppSettings["Facebook_Access_Token1"]) + "&q=" + searchString + "&offset=0&limit=1000&fields=name,link,gender,languages,location,address,education,work,picture

完整网址供参考:

https://graph.facebook.com/search?type=user&access_token=<access_token>&q=f%3DPulkit&offset=0&limit=1000&fields=name,link,gender,languages,location,address,education,work,picture

如果我直接尝试通过浏览器访问此网址,则会出现以下错误信息:

{
   "error": {
      "message": "Error validating access token: Session has expired on Sunday, 22-Feb-15 23:22:13 PST. The current time is Monday, 02-Mar-15 04:47:31 PST.",
      "type": "OAuthException",
      "code": 190,
      "error_subcode": 463
   }
}

此代码在Java Rest服务之前工作正常。但现在它不能这样工作。任何指针都会有所帮助。感谢。

1 个答案:

答案 0 :(得分:1)

您正在使用已过期的访问令牌,您需要通过OAuth登录流程将用户发回。

https://developers.facebook.com/docs/facebook-login/access-tokens#extending