【发布时间】:2018-05-03 08:18:15
【问题描述】:
我将 Identity Server 4 与我的 ASP.NET Core MVC 应用程序一起使用。它工作正常。然后我尝试使用以下代码设置访问令牌和身份令牌生命周期。
//AccessTokenLifetime = new TimeSpan(2,0,0).Seconds, /*This is not working*/
AccessTokenLifetime = 7200, /* This is setting the life time correctly */
当我检查数据库中的“[Clients]”表时,AccessTokenLifeTime 设置为 0(如果使用 TimeSpan(2,0,0))。但是如果我直接分配整数 7200 那么它会正确设置访问令牌的生命周期。
这种行为有什么原因吗?
【问题讨论】:
标签: asp.net-identity asp.net-core-2.0 identityserver4