(OAuthException - #1)验证客户端密钥时出错

时间:2014-04-25 06:31:51

标签: facebook-c#-sdk

我正在尝试使用C# SDKv6(桌面应用)实施Facebook应用。但是当我获得访问令牌时,我收到此错误 (OAuthException - #1) Error validating client secret

这是代码的一部分:

dynamic result = fb.Get("oauth/access_token", new
            {
                client_id = appId,
                redirect_uri = redircct,
            });

1 个答案:

答案 0 :(得分:0)

你错过了client_secret:

var oauthClient = new FacebookOAuthClient { AppId = "app_id", AppSecret = "app_secret", RedirectUri = new Uri("http://redirecturi.com") };

dynamic result = oauthClient.ExchangeCodeForAccessToken("code"); var accessToken = result.access_token;

Here is the reference

and a similar question