IIS - 集成管道模式下默认文档的不同处理?
我有一个 HTTP 模块来处理来自 Facebook 的身份验证,它在经典管道模式下运行良好。
然而,在集成管道模式下,我看到默认文档传递了一个额外的请求,这导致模块失败。 我们查看(来自 Facebook 的)请求,以检索并验证访问我们应用程序的用户。 初始请求身份验证正常,但随后我看到第二个请求,该请求缺少发布的表单变量,从而导致身份验证失败。
在集成管道模式下,对“/”的 http 请求会连续产生 2 个 AuthenticateRequest:
- AppRelativeCurrentExecutionFilePath = "~/" 的请求
- AppRelativeCurrentExecutionFilePath = "~/default.aspx" 的请求
第二个请求会丢失所有表单值,所以它无法验证。 在经典模式下,第二个请求是唯一发生的请求,并且它保留表单值。
有什么想法吗?
更新:这是 IIS 中模块通知的跟踪图像。 请注意,我的模块 FBAuth 多次看到 AUTHENTICATE_REQUEST (我期望 2 次 - 一次用于身份验证,一次用于后验证,但我得到了 4 次)。
我开始相信这与模块/过滤器配置,因为我发现一个运行相同代码的(Vista)框不会重复触发这些事件 - 它的行为符合预期。 我正在努力找出其中的区别...
谢谢! 汤姆
I have an HTTP Module to handle authentication from Facebook, which works fine in classic pipeline mode.
In integrated pipeline mode, however, I'm seeing an additional request pass through for the default document, which is causing the module to fail. We look at the request (from Facebook) to retrieve and validate the user accessing our app. The initial request authenticates fine, but then I see a second request, which lacks the posted form variables, and thus causes authentication to fail.
In integrated pipeline mode, an http request for "/" yields 2 AuthenticateRequests in a row:
- A request where AppRelativeCurrentExecutionFilePath = "~/"
- A request where AppRelativeCurrentExecutionFilePath = "~/default.aspx"
That second request loses all of the form values, so it fails to authenticate. In classic mode, that second request is the only one that happens, and it preserves the form values.
Any ideas what's going on here?
UPDATE: Here is an image of the trace from module notifications in IIS. Note that my module, FBAuth, is seeing AUTHENTICATE_REQUEST multiple times (I'd expect 2 - one for authenticate and one for postauthenticate, but I get 4).
I'm starting to believe this has something to do with module/filter configuration because I've found a (Vista) box running the same code that doesn't fire these events repeatedly - it behaves as expected. I'm working through trying to figure out what the difference could be...
Thanks!
Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的解决方案是在Application_BeginRequest末尾添加以下代码:
My solution was to add the following code at the end of Application_BeginRequest: