如何在没有任何登录弹出窗口的情况下使用appid和app secret获取facebook访问令牌。

问题描述:

我需要在C#windows应用程序中使用appid和app secret获取FaceBook用户访问令牌,而无需任何Facebook登录弹出窗口。实际上我做了以下编码,但只获取应用程序令牌,而不是获取用户访问令牌。如何让用户访问令牌在FB Wall中发布。?



Graph API Explorer(https://developers.facebook.com/tools/explorer)生成一个访问令牌,通常长度为118个字符,而返回的令牌则少得多。



FacebookClient客户端=新FacebookClient();

dynamic result = client.Get(oauth / access_token,new

{

client_id =XXXXXXXXXXXXXXX,

client_secret =XXXXXXXXXXXXXXXXXXX ,

grant_type =client_credentials

});

var accessToken = result.access_token;



帮我继续......

I need to get FaceBook user access token using appid and app secret in C# windows application without any Facebook login pop up window. Actually i did below coding, but getting app token only,not getting the user access token. how to get user access token to post in a FB Wall.?

The Graph API Explorer (https://developers.facebook.com/tools/explorer) generates an access token which is typically 118 characters in length, whereas the token returned is far less.

FacebookClient client = new FacebookClient();
dynamic result = client.Get("oauth/access_token", new
{
client_id = "XXXXXXXXXXXXXXX",
client_secret = "XXXXXXXXXXXXXXXXXXX",
grant_type = "client_credentials"
});
var accessToken = result.access_token;

Help me to proceed further..