新しい asp.net webform .net 4.0 を作成し、AuthConfig.cs を構成するときに、Microsoft.AspNet.Membership.OpenAuth を使用しています。
OpenAuth.AuthenticationClients.AddFacebook(
appId: "my appId",
appSecret: "my appSecret");
Facebook アプリの構成: Facebook ログインのある Web サイト: http://www.tindep.com
しかし、Facebookでログインするとエラーになります:
Server Error in '/' Application.
The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote server returned an error: (400) Bad Request.]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +283
System.Net.WebClient.DownloadString(Uri address) +100
DotNetOpenAuth.AspNet.Clients.FacebookClient.QueryAccessToken(Uri returnUrl, String authorizationCode) +235
DotNetOpenAuth.AspNet.Clients.OAuth2Client.VerifyAuthentication(HttpContextBase context, Uri returnPageUrl) +142
DotNetOpenAuth.AspNet.OpenAuthSecurityManager.VerifyAuthentication(String returnUrl) +239
Microsoft.AspNet.Membership.OpenAuth.OpenAuthManager.VerifyAuthentication(HttpContextBase context, String returnUrl) +116
Microsoft.AspNet.Membership.OpenAuth.OpenAuth.VerifyAuthentication(String returnUrl) +82
EVNSoft.Website.Account.RegisterExternalLogin.ProcessProviderResult() +205
EVNSoft.Website.Account.RegisterExternalLogin.Page_Load() +24
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +9808229
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18055
Google、Twitter、msdn のログインは成功しましたが (tindep.com/Account/Login.aspx を確認)、ホスティング (tindep.com/Account/Login.aspx) でのみエラーです。localhost:57846/Account/Login.aspx Facebook のログイン成功。
原因を見つけるのを手伝ってください。
おかげで多くの!