在与提供者打交道时,要在 HttpModule 中处理哪个事件来设置当前主体?

发布于 2024-07-29 11:44:05 字数 211 浏览 3 评论 0原文

我面临一个问题,我必须与自定义 HttpModule 集成,其中主体和身份是在当前线程上设置的,以便 HttpContext.Current.User 包含这些。 但是我感觉他们使用的事件处理程序(PostAcquireRequestState)太晚了。

在 HttpModule 中发生提供者初始化之前,最好处理哪个事件? 我想要的只是我的自定义提供商能够使用正确的主体和身份。

I am facing a problem where I have to integrate with a custom HttpModule where the principal and identity are set on the current thread so that HttpContext.Current.User contains these. However I get the feeling that the eventhandler they used (PostAcquireRequestState) is way too late.

Which is the best event to handle before the initialization of the providers happen in the HttpModule? All I want is my custom provider to work with the correct principal and identity.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

以歌曲疗慰 2024-08-05 11:44:11

这可能最好在 PostAuthenticateRequest 事件中完成。 ASP.NET 假定在此事件之后安全信息是稳定的。

This is probably best done in the PostAuthenticateRequest event. ASP.NET assumes that after this event the security information is stable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文