1
我在.NET的核心谷歌认证工作,但是从谷歌重定向时,它显示我exception- InvalidOperationException异常:无认证处理程序被配置为处理方案:饼干谷歌认证Exception-无认证处理程序被配置为处理方案:饼干
这里是我的startup.cs设置
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
LoginPath = new PathString("/account/login"),
AuthenticationScheme = "MyCookieMiddlewareInstance",
AutomaticAuthenticate = true,
AutomaticChallenge = true,
AccessDeniedPath = new PathString("/Home/AccessDenied"),
});
app.UseGoogleAuthentication(new GoogleOptions
{
AuthenticationScheme = "Google",
DisplayName = "Google",
SignInScheme = "Cookies",
ClientId = "ClientId ",
ClientSecret = "ClientSecret ",
Scope = { "email", "openid" },
CallbackPath = "/home",
});
请建议我在哪里,我错了
AddCookieAuthentication不是IServiceCollection对象的方法。我确认这个名字空间被引用,并且仍然得到这个异常。 –
@NathanTregillus请检查我的更新 – Set