简体   繁体   English

netcoreapp2.0预览版2。 身份配置

[英]netcoreapp2.0 preview2. Identity configuration

There is a problem with cookies configuration. Cookies配置存在问题。 In chrome everything works fine, but there are some problems with Postman. 在chrome中,一切正常,但是Postman存在一些问题。 It doesn't define all the cookies. 它没有定义所有的cookie。 (Interceptor is on). (拦截器已打开)。

Here is my identity configuration 这是我的身份配置

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();
}

With netcoreapp1.1 and this configuration 使用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");
     }
}

everything works fine 一切正常

Any suggestions? 有什么建议么?

问题出在Postman(仅桌面应用) https://github.com/postmanlabs/postman-app-support/issues/3146

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM