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

Identity Token Expiration In ASP NET Core #999

Closed
chassq opened this issue Oct 19, 2016 · 3 comments
Closed

Identity Token Expiration In ASP NET Core #999

chassq opened this issue Oct 19, 2016 · 3 comments

Comments

@chassq
Copy link

chassq commented Oct 19, 2016

Hey,

Can anyone point us to the documentation where it specifies hoe to control the default token provider expiration? We would like to extend this expiration timeout if possible. Here is a sample of our current service config:

        services.AddIdentity<ApplicationUser, IdentityRole>(
            options => {

                options.Cookies.ApplicationCookie.AuthenticationScheme = "ApplicationCookie";
                options.Cookies.ApplicationCookie.CookieName = "<some name>";
                options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromMinutes(SettingsProviderApp.AuthCookieExpiresInMinutes);
            })
            .AddEntityFrameworkStores<ApplicationDbContext>()
            .AddDefaultTokenProviders();

Would we have to override the default token providers? If so are there any examples of this?

We are referencing:
"Microsoft.AspNetCore.Identity": "1.0.0",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",

Any help much appreciated!

Thanks!

@blowdart
Copy link
Member

Dupe of #859

@cbettero
Copy link

No, it's not the duplicate of #859,
we have the same problem: even if we set the ExpireTimeSpan like this:

options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromMinutes(120);
the authentication seems to expire, randomly, after about 20 minutes.

What can be the problem ?
We are running ASP.NET Core 1.1 on IIS.

Thanks

@groege
Copy link

groege commented Dec 14, 2017

We have the same problem in my company and think it is the worker process lifetime.
It seems like after 20 minutes the worker is killed (if not used)... should the token not be valid even if the worker has been killed?
Maybe someone can verify? Because we may be wrong.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants