如何使用wcf服务获取facebook授权码

时间:2015-07-30 05:14:00

标签: c# facebook wcf authorization facebook-access-token

我有wcf服务功能,可以将图像上传到Facebook应用程序。 如何为此目的获取授权代码。我需要为以下用户令牌生成目的生成授权代码。 如何生成授权码?

dynamic token = fb.Get("oauth/access_token", new
           {
               client_id = "104685639880509",
               client_secret = "xxxxxxxxxxxxxxxxxxx",
               redirect_uri = "http://localhost:50487/SRMPServiceApplication.svc",
               code = "code"
           });

1 个答案:

答案 0 :(得分:0)

从此链接生成扩展授权令牌

https://developers.facebook.com/tools/accesstoken/

dynamic token = fb.Get("oauth/access_token", new
            {
                client_id = "104685639880509",
                client_secret = "xxxxxxxxxxxxxxxxxxx",
                grant_type = "fb_exchange_token",
                fb_exchange_token = "your extended authorization token"
            });

            fb.AccessToken = token.access_token;