我使用asp.net MVC webapi,并且已经使用facebook登录了很长时间。但突然出现如下错误:
以下代码: Startup.Auth.cs
FacebookAuthenticationOptions options = new FacebookAuthenticationOptions();
options.AppId = ConfigurationManager.AppSettings["FBappId"];
options.AppSecret = ConfigurationManager.AppSettings["FBappSecret"];
string[] FBScopes = ConfigurationManager.AppSettings["FBScope"].ToString().Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
foreach (string s in FBScopes)
{
options.Scope.Add(s);
}
Microsoft.Owin.Security.Twitter.Messages.RequestToken request = new Microsoft.Owin.Security.Twitter.Messages.RequestToken();
options.Provider = new FacebookAuthenticationProvider()
{
OnAuthenticated = async context =>
{
//Get the access token from FB and store it in the database and
//use FacebookC# SDK to get more information about the user
context.Identity.AddClaim(
new System.Security.Claims.Claim("FacebookAccessToken", context.AccessToken));
}
};
options.SignInAsAuthenticationType = DefaultAuthenticationTypes.ExternalCookie;
//options.SignInAsAuthenticationType = Microsoft.Owin.Security.AppBuilderSecurityExtensions.GetDefaultSignInAsAuthenticationType(app);
app.UseFacebookAuthentication(options);
到目前为止它工作正常并且没有出现过这样的错误。有人知道为什么会这样吗?
Facebook是否有任何安全更改?
请告诉我。