Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

ASP.NET Core 2.0 Identity Expiration #1478

Description

@CarbonFactory

There is a cookie with the name ".AspNetCore.Identity.Application" added after I login the user and it's expiration time is set to 14 days from now, 2017-11-05T15:52:03.669Z

 services.AddIdentity<ApplicationUser, ApplicationRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>()
                .AddUserManager<ApplicationUserManager>()
                .AddSignInManager<ApplicationSignInManagerr>()
                .AddDefaultTokenProviders();


services.AddMvc(opts =>
            {
                opts.Filters.AddService(typeof(AjaxAntiforgeryCookieResultFilter));
            })
 services
                .AddAuthentication()
                .AddJwtBearer(options =>
                {
                    options.RequireHttpsMetadata = false;
                    options.SaveToken = true;
                    options.TokenValidationParameters = tokenValidationParameters;
                    options.Events = jwtBearerEvents;
                });

            services.ConfigureApplicationCookie(options =>
            {
                options.AccessDeniedPath = new PathString("/login");
                options.LoginPath = new PathString("/login");
                options.Cookie.Expiration = TimeSpan.FromMinutes(1);
            });

            services.AddAuthorization();

Above is the related part of the code for brevity.

How do I ensure that after 10 mins, if the user refreshes the webpage, he is logged out and re-directed to login.

The ConfigureApplicationCookie values seem to be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions