この質問は、私と同様、to my previous oneと思われます。 最後の行に次のコードで「必要なのClientIDは、」私はメッセージで例外を取得し、.NET 4に、最新のC#のFacebook SDKを使用して:Facebook C#SDK OAuth例外 "ClientIDが必要"
var app = new DefaultFacebookApplication();
app.AppId = "appId";
app.AppSecret = "secret";
var fb = new FacebookWebContext(app);
fb.IsAuthenticated();
のApp IDとシークレットが正しく設定されています。例外のスタックトレースは以下の通りです:
FB.init({
appId: appId,
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true, // parse XFBML
oauth: true // enable OAuth 2.0
});
をユーザが適切に記録されます: のSystem.Exceptionは、私は次のように初期化JS SDKを使用しているクライアント側で
Message=ClientID required. Source=Facebook StackTrace:
at Facebook.FacebookOAuthClient.BuildExchangeCodeForAccessTokenParameters(IDictionary`2 parameters, String& name, String& path)
at Facebook.FacebookOAuthClient.ExchangeCodeForAccessToken(String code, IDictionary`2 parameters)
at Facebook.FacebookSession.get_AccessToken()
at Facebook.FacebookSession.get_Expires()
at Facebook.Web.FacebookWebContext.IsAuthenticated()
at Piedone.FacebookTest.Authorize() InnerException:
を発生しましたJSログイン()メソッドで、次のコードでアラートとして実行:Facebook上でアプリの設定で
FB.login(function (response) {
if (response.authResponse) {
alert("logged in");
} else {
alert('User cancelled login or did not fully authorize.');
}
}, { scope: scope });
を両方とも「軍ログインの使用OAuthコールのための秘密とauth.login "と" Encrypted Access Token "がオンになっています。私が知る限り、これはすべてOAuth 2認証の使用を可能にするはずです。 誰かが私は何を間違えているのか考えていますか?これらのコード行には実際には何らかのエラーはありません。
ありがとうございました!
編集:はFacebookWebContextのAccessTokenプロパティは同じエラーをスローしHttpContext.CurrentNotification ん:私は現在だと、私は(その開発サーバーでのVisual Studioからプログラムを実行する必要がありますので
CurrentNotification '(_facebookWebContextCache.HttpContext).CurrentNotification' threw an exception of type 'System.PlatformNotSupportedException' System.Web.RequestNotification {System.PlatformNotSupportedException}
This operation requires IIS integrated pipeline mode.
アプリケーションの開発)、後者の例外については何もできません。実際に私はWebmatrixのIISエクスプレスでも試しましたが、問題は解決しません。
...編集2それはFacebookWebContextの設定(アプリIDは、秘密)が正しく、ユーザーID、同様に設定されていること、また面白いと署名要求もあります: 私も取得SDKソースを使用しているときと同じエラーです。そのAccessTokenを見て、Expiresプロパティのセッションで例外がスローされます。私はこれが上記のhttpcontext問題に接続されているかどうかわかりません。
はまた、問題を開く:http://facebooksdk.codeplex.com/workitem/5902 – Piedone
Prabirシュレスタは、すでに最新のチェックインと簡単な修正を行うolledます。http:/ /facebooksdk.codeplex.com/SourceControl/changeset/changes/7ce3c54e1aea – Piedone