Search code examples
c#cookiesasp.net-coreasp.net-identitypostman

netcoreapp2.0 preview2. Identity configuration


There is a problem with cookies configuration. In chrome everything works fine, but there are some problems with Postman. It doesn't define all the cookies. (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

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?


Solution

  • The problem was with Postman (Desktop app only) https://github.com/postmanlabs/postman-app-support/issues/3146