【发布时间】:2018-02-11 03:39:30
【问题描述】:
我的 openiddict 配置如下
services.AddOpenIddict(options =>
{
options.AddEntityFrameworkCoreStores<TestDbContext>();
options.AddMvcBinders();
options.EnableAuthorizationEndpoint("/connect/authorize")
.EnableLogoutEndpoint("/connect/logout")
.EnableIntrospectionEndpoint("/connect/introspect")
.EnableUserinfoEndpoint("/api/userinfo");
options.AllowImplicitFlow();
options.RequireClientIdentification();
options.EnableRequestCaching();
options.DisableSlidingExpiration();
options.AddSigningCertificate(
assembly: typeof(Startup).GetTypeInfo().Assembly,
resource: "Server.test.pfx",
password: "test"); // embedded resource
options.SetAccessTokenLifetime(TimeSpan.FromDays(1));
options.SetIdentityTokenLifetime(TimeSpan.FromDays(1));
});
当我在本地测试时,令牌似乎与上面指定的一样长,但在生产(Windows Server 2016 IIS 10)上它过早过期(大约 1 小时)。 netcore1 和 netcore2 都是这种情况。 我知道我可以选择进行静默令牌更新,但现在想避免该过程。这种行为是否有任何已知原因?
【问题讨论】:
-
也许事实是,1 小时是 default AccessTokenLifetime 以某种方式帮助您找到问题的根源
标签: asp.net-core iis-10 openiddict