2017-07-27 43 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 –

回答

相關問題