【发布时间】:2017-07-15 04:59:20
【问题描述】:
我们有一个 IdentityServer4,一个作为客户端的 MVC 应用程序和一个作为受保护资源的 API。
Client(IdentityServer 中的类)具有以下属性:AccessTokenLifetime、IdentityTokenLifetime、AuthorizationCodeLifetime。
如果我们将这些属性设置为不同的值(想象 1 小时、2 小时和 3 小时)。这些属性与 cookie 到期时间跨度有何关系?
cookie 中间件(在 MVC 客户端上)看起来像这样,过期时间为 8 小时。 IdentityServer 上的 cookie 中间件的过期时间跨度为 10 小时。
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationScheme = "Cookies",
AutomaticAuthenticate = true,
ExpireTimeSpan = TimeSpan.FromHours(8)
});
如果令牌在 cookie 过期之前过期会发生什么情况,反之亦然,应该如何处理?
【问题讨论】:
标签: asp.net-core asp.net-core-mvc identityserver4