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");
}
}
一切正常
有什么建议么?
问题出在 Postman(仅限桌面应用程序)https://github.com/postmanlabs/postman-app-support/issues/3146
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句