【发布时间】:2017-04-25 10:00:44
【问题描述】:
我在 .net 核心中使用 google 身份验证,但是当从 google 重定向时,它显示异常- InvalidOperationException:没有配置身份验证处理程序来处理该方案:Cookies
这是我的 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",
});
请指出我哪里错了
【问题讨论】:
标签: c# authentication asp.net-core google-authentication