IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Question: Why DefaultCookieTimeSpan is set by default to 10 hours?

Open igor-moskvitin opened this issue 8 years ago • 7 comments

I see that by default in AspNetCore timespan is set to 14 days, but for IdentityServer defaults it sets to 10 hours. Can you provide reasons for reduce this time? Now i have an issue when use renew access_token after 10 hours and set CookieLifetime to 24 hours, but what possible risks it intoduced?

igor-moskvitin avatar Oct 03 '18 05:10 igor-moskvitin

To be more precise: 10 hour, no sliding. It was chosen because it's a reasonable and safe default. You can change it to anything you want.

brockallen avatar Oct 03 '18 12:10 brockallen

And why it is more safe? What kind of attacks can use an extended lifetime for this cookie? I know that i can extend this, but want to know about reason to reduce it for default in IdSrv4.

igor-moskvitin avatar Oct 03 '18 17:10 igor-moskvitin

In our experience, most uses of IdentityServer expect a 10 hour fixed SSO session. It's a reasonable and safe default. I think the context is important too -- a user's lifetime in the SSO server is different than a user's lifetime in a general purpose ASP.NET Core MVC app.

Perhaps you should be asking why Microsoft chose 14 days by default for their cookie.

brockallen avatar Oct 03 '18 17:10 brockallen

Microsoft's own internal Kerberos setting is 11 hours. It was meant to correspond to a work day so that the net effect was to force a new signin for a new day. So I can see extending the 10 hour range a little, but multiple days seems (to me at least) as unwise.

TomCJones avatar Oct 03 '18 17:10 TomCJones

Yes, and @TomCJones's source is what we basically modeled our choice on.

brockallen avatar Oct 03 '18 19:10 brockallen

Ok. Thanks.

igor-moskvitin avatar Oct 04 '18 10:10 igor-moskvitin

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jan 12 '20 22:01 lock[bot]