混合经过身份验证和未经身份验证的 URL、Internet Explorer 和 mod_auth_sspi
设置:Apache 2.2、mod_auth_sspi 1.0.3/1.0.4、mod_wsgi 3.3、python 2.6.2
一些背景信息:每当 IE 访问某个 URL 时,就需要它执行 NTLM 质询响应,进一步向同一 发出 POST 请求域执行如下:
- 执行零长度 POST(内容长度 0)
- 服务器回复 401。 WWW-Authenticate 标头包含 NTLMSSP 质询
- 发送“真实”(全长)POST授权标头设置为 NTLMSSP_AUTH(响应)
并且一切正常。
然而,一旦不需要身份验证的页面(服务器不响应 401)被点击,可怕的事情就会发生 - 零长度的 POST 会立即转发到应用程序,并且随之而来的是各种奇怪的情况, - 表单不会无法正确提交、文件未上传等等。我在 IE 7 和 8 中观察到了这种行为。
这不是猜测,- 我实际上嗅探了流量,一切都与我上面概述的完全一样。
有人遇到过这种情况吗?我想知道在这种情况下最干净的解决方法是什么。或者也许,这不是问题,我只是看到了一些东西?
Setup: Apache 2.2, mod_auth_sspi 1.0.3/1.0.4, mod_wsgi 3.3, python 2.6.2
Some background information: Whenever IE hits an URL, that requires it to perform NTLM challenge-response, further POST requests to the same domain are performed as follows:
- A zero-length POST (Content-Length 0) is performed
- The server replies with 401. WWW-Authenticate header contains the NTLMSSP challenge
- A 'real' (full-length) POST is sent with the Authorization header set to the NTLMSSP_AUTH (response)
And everything is ok.
However, once the page, that doesn't require authentication (the server doesn't respond with 401) is hit, terrible things happen - the zero-length POST is promptly forwarded to the application and all sorts of weirdness ensues, - forms don't get submitted properly, files are not uploaded and so on. I've observed this behaviour with IE 7 and 8.
This is not speculation, - I've actually sniffed the traffic and everything goes exactly as I've outlined above.
Has anyone ever encountered this? I am wondering, what would be the cleanest workaround in this case. Or maybe, this is a non-problem and I am just seeing things?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 Microsoft 知识库文章 251404 (http://support.microsoft.com/kb /251404/en-us)。
它基本上解释了发生的情况以及如何解决该问题。
Have a look at the Microsoft KnowledgeBase Article 251404 (http://support.microsoft.com/kb/251404/en-us).
It basically explains what happens and how to work around the issue.