Cookie配置存在问题。在chrome中一切正常,但Postman存在一些问题。它没有定义所有的cookie。 (拦截器开启)。
这是我的身份配置
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 :(得分:0)
问题在于Postman(仅适用于桌面应用) https://github.com/postmanlabs/postman-app-support/issues/3146