gpt4 book ai didi

asp.net-core - Hook 到 IdentityServer4 session cookie 滑动过期

转载 作者:行者123 更新时间:2023-12-04 15:18:54 24 4
gpt4 key购买 nike

当 IdentityServer 对 session cookie (idsrv) 执行过期时间滑动时,我需要运行一些自定义代码(管理另一个自定义 cookie)。

如何或在何处连接到 IdentityServer 管道以完成此操作?是否有我可以覆盖的内容或是否有我可以订阅的事件?

我目前在 asp.net core 3.1 应用程序中使用 IdentityServer4 3.x。

最佳答案

AddIdentityServer扩展只是添加默认的 cookie 处理程序。并设置 CookieAuthenticationOptions基于传递值的 Prop 。

根据官方描述,滑动过期是这样的:

The SlidingExpiration is set to true to instruct the handler to re-issue a new cookie with a new expiration time any time it processes a request which is more than halfway through the expiration window.

考虑到这些,如果您需要对滑动 session cookie 的到期时间 做某事,您需要有一个自定义的 cookie 处理程序,它以不同的方式做事

关于asp.net-core - Hook 到 IdentityServer4 session cookie 滑动过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63776309/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com