2017-07-27 17 views
0

Cookie配置有问题。在铬一切正常,但邮递员有一些问题。它没有定义所有的cookies。 (拦截器打开)。netcoreapp2.0 preview2。身份配置

这里是我的身份配置

ConfigureServices() 
{ 
    services.AddAuthentication(auth => 
    { 
     auth.DefaultChallengeScheme =CookieAuthenticationDefaults.AuthenticationScheme; 
     auth.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; 
    }).AddCookieAuthentication(auth => 
    { 
     auth.LoginPath = "/account/login"; 
     auth.LogoutPath = "/account/logout"; 
    } 
} 

Configure() 
{ 
    app.UseAuthentication(); 
} 

随着netcoreapp1.1和这个配置

Configure() 
{ 
    app.UseIdentity(); 
} 
ConfigureServices() 
{ 
    services.Configure<IdentityOptions>(options => 
    { 
     options.Cookies.ApplicationCookie.LoginPath = new PathString("/account/login"); 
     options.Cookies.ApplicationCookie.LogoutPath = new PathString("/account/logout"); 
    } 
} 

一切正常

有什么建议?

+0

你只添加一个cookie时,你期待什么其他的饼干? –

+0

@JoeAudette你是对的,邮差和Chrome都只设置.AspNetCore.Identity.Application cookie。我认为有一些身份问题。 https://blogs.msdn.microsoft.com/webdev/2017/06/28/introducing-asp-net-core-2-0-preview-2/ NET Core Identity as a Service is Postponed features –

回答

相关问题