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

问题描述:

我正在尝试使用WCF服务为Facebook网址创建HttpWebRequest。它给出了WCF错误请求错误:Facebook访问令牌为用户搜索提供了错误代码190和错误子代码463

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 

完整的URL以供参考:

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 

如果我直接尝试通过浏览器访问这个URL它提供了以下错误信息:

{ 
    "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服务运行良好。但现在它不能这样工作。任何指针都会有帮助。谢谢。

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

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