0
我有以下的在我的启动类的dotnetcore web应用程序:UseCookieAuthentication犯规重定向到登录页面asp.net核心
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies",
AutomaticAuthenticate = true,
AutomaticChallenge = true,
LoginPath = "/account/login"
})
我得到一个401未经授权但不重定向到我/帐号/登录页面 - 任何想法?
是否已确认'ConfigureAuth()'是不断叫什么名字? –
在Configure方法中添加app.UseMvc(routes => { routes.MapRoute( name:“default”, template:“{controller = account}/{action = login}/{id?}”); }); –