[英]How to generate User_token using Facebook C# SDK
I'm trying to perform a search for public posts by facebook graph api. 我正在尝试通过facebook graph api搜索公共帖子。
I got the access token by executing this code: 通过执行以下代码,我获得了访问令牌:
dynamic tokenInfo =
fb.Get(
String.Format(
"/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials",
ConsumerKey,
ConsumerSecret));
var appAccessToken = (string)tokenInfo.ToString();// tokenInfo.access_token;
And I put this access token in my url like this: 我将这个访问令牌放在我的网址中,如下所示:
https://graph.facebook.com/search?access_token=111111111111111|xxxxxxxxxxxxxx-xxxxxx&type=post&metadata=1&callback=display&q=voyage&since=2013-07-10&limit=500000
But I'm getting the message bellow: 但是我得到的消息如下:
/**/ display({
"error": {
"message": "(#15) Requires session when calling from a desktop app",
"type": "OAuthException",
"code": 15
}
});
I have been trying to find the answer to the same question, From what i learned, 我一直在努力寻找相同问题的答案,从我学到的知识,
We need to get User_token and use it as, 我们需要获取User_token并将其用作,
https://graph.facebook.com/search?access_token={User_token}&type=post&metadata=1&callback=display&q=voyage
You can get an User_token at https://developers.facebook.com/tools/access_token/ 您可以通过https://developers.facebook.com/tools/access_token/获得User_token。
Then it is indeed working. 然后确实可以正常工作。 But the question is how do we generate User_token?
但是问题是我们如何生成User_token?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.