B2C Web 应用会话生命周期
B2C Web app session lifetime
我正在使用 B2C 门户分配以下值。我假设 web app session lifetime
设置会有效地设置 cookie 过期时间。但无论我做什么,它都会在 两周 后再次出现。 (今天是14号)
如果我使用 TicketReceived
事件设置 context.Properties.ExpiresUtc
,那么我设置的值会显示在 cookie 中。
如果web app session lifetime
不应该设置cookie,那么它有什么用?无论如何,我不知道两周是从哪里来的。
据我所知,Token Lifetimes 中的以下值在它返回时设置 exp
声明。这似乎只适用于 JWT。
有人可以解释一下吗?
TIA
很久以前我也在为这个问题苦苦挣扎,这是我的看法:
Web app session timeout
用于 B2C 的 cookie,因此如果您登录第二个 B2C 安全应用程序,则无需在 B2C 重新登录。这不是您要查找的值。
应将令牌生命周期复制到您自己的环境中。
查看一些关于 UseTokenLifetime
的文档
另请阅读此处:
https://github.com/aspnet/Security/issues/147
We believe the default of true is overall the safest:
When using ASP.NET Identity, it will replace the cookie with its own cookie that has its own expiration rules
When using OIDC is the primary authentication, the value of true is presumably what people want.
这里还有更多信息:
代码片段:
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
....
UseTokenLifetime = true,
....
我正在使用 B2C 门户分配以下值。我假设 web app session lifetime
设置会有效地设置 cookie 过期时间。但无论我做什么,它都会在 两周 后再次出现。 (今天是14号)
如果我使用 TicketReceived
事件设置 context.Properties.ExpiresUtc
,那么我设置的值会显示在 cookie 中。
如果web app session lifetime
不应该设置cookie,那么它有什么用?无论如何,我不知道两周是从哪里来的。
据我所知,Token Lifetimes 中的以下值在它返回时设置 exp
声明。这似乎只适用于 JWT。
有人可以解释一下吗?
TIA
很久以前我也在为这个问题苦苦挣扎,这是我的看法:
Web app session timeout
用于 B2C 的 cookie,因此如果您登录第二个 B2C 安全应用程序,则无需在 B2C 重新登录。这不是您要查找的值。
应将令牌生命周期复制到您自己的环境中。
查看一些关于 UseTokenLifetime
另请阅读此处:
https://github.com/aspnet/Security/issues/147
We believe the default of true is overall the safest: When using ASP.NET Identity, it will replace the cookie with its own cookie that has its own expiration rules When using OIDC is the primary authentication, the value of true is presumably what people want.
这里还有更多信息:
代码片段:
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
....
UseTokenLifetime = true,
....