【发布时间】:2023-03-12 22:40:02
【问题描述】:
看似重复的问题,但没有详细回答。 好吧,至少我不相信。
Who sets the IsAuthenticated property of the HttpContext.User.Identity
答案是
FormsAuthentication.SetAuthCookie
但是我反编译了 System.Web.Security FormsAuthenication 类。 它调用 GetAuthCookie 并将其添加到响应中。
当找到 Session Cookie 而不是在 FormsAuthentication 中,如“正确答案”所述,我期待它出现在下一个请求中。 我搜索了完整的反编译源,但没有找到对 IPrincipal 的引用。 有人真的知道吗? 我可以用和 Event. 触发这个过程吗? 我注意到诸如
之类的事件AuthenticateRequest
和AuthorizeRequest
【问题讨论】:
标签: asp.net-mvc forms-authentication security