Openiddict implicitflow 令牌过早过期
Openiddict implicitflow premature token expiration
我的 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 服务器 2016 IIS 10)它过早过期(大约 1 小时后)。 netcore1 和 netcore2 都是这种情况。
我知道我可以选择进行静默令牌更新,但现在想避免该过程。这种行为有任何已知原因吗?
when i test locally, the token seems to live as long as specified above, but on production (windows server 2016 IIS 10) it expires prematurely (in about 1 hour).
默认情况下,OpenIddict 使用 ASP.NET 核心数据保护来加密其访问令牌。
要使数据保护堆栈正常工作,您必须在投入生产时对其进行配置。有关详细信息,请参阅 。
我的 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 服务器 2016 IIS 10)它过早过期(大约 1 小时后)。 netcore1 和 netcore2 都是这种情况。 我知道我可以选择进行静默令牌更新,但现在想避免该过程。这种行为有任何已知原因吗?
when i test locally, the token seems to live as long as specified above, but on production (windows server 2016 IIS 10) it expires prematurely (in about 1 hour).
默认情况下,OpenIddict 使用 ASP.NET 核心数据保护来加密其访问令牌。
要使数据保护堆栈正常工作,您必须在投入生产时对其进行配置。有关详细信息,请参阅