Tag: Facebook的身份validation

必须提供“SignInScheme”选项

我正在创建一个仅使用Facebook / Google身份validation的ASP.NET 5 MVC 6应用程序。 我也试图在没有整个ASP.NET身份的情况下使用cookie中间件 – 遵循这篇文章: https : //docs.asp.net/en/latest/security/authentication/cookie.html 所以我开始使用没有身份validation的空白应用程序然后添加了Microsoft.AspNet.Authentication.Cookies和Microsoft.AspNet.Authentication.Facebook NuGet包,以便采用非常简约的方法,其中我不包含任何我不包含的内容需要。 我将以下代码添加到Startup.cs中的Configure中,但我得到“必须提供SignInScheme选项”错误。 知道我错过了什么吗? app.UseCookieAuthentication(options => { options.AuthenticationScheme = “MyCookieMiddlewareInstance”; options.LoginPath = new PathString(“/Accounts/Login/”); options.AccessDeniedPath = new PathString(“/Error/Unauthorized/”); options.AutomaticAuthenticate = true; options.AutomaticChallenge = true; }); app.UseFacebookAuthentication(options => { options.AppId = “myFacebookAppIdGoesHere”; options.AppSecret = “myFacebookAppSecretGoesHere”; });