当 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/