问题
I am maintaining a custom WebDav server, which works smoothly with most WebDav clients such as Cadaver, Mac OSX, etc, but does not work with Windows mini-redirector, i.e. net drive in Windows Explorer.
The server implemented Digest authentication.
The symptom is: I was always prompted for entering username and password even after I entered correct credentials. Even more weird thing is, when I am using Fiddler, the problem is gone.
I have looked into several possibilities: 1. persistent connection issue, but my apache server enabled digest and webdav works smoothly with win 7 client. 2. default namespace issue. https://issues.apache.org/bugzilla/show_bug.cgi?id=49428, but my server does not have this problem neither.
Could you please give me some hints on this ? Thank you
回答1:
This turned out to be a connection issue. The root cause was that win7 mini-redirector DOES NOT send cached "Authorization" header when previous connection was dropped.
The usual handshake of Digest is like this:
- client starts a connection C, send request R
- server response with a 401, send back through connection C, drop it or not, it depends
- client get the 401, compute an "Authorization" header
- if C does not exist anymore, start another connection C', and send another request R' including the header through C', or if C is still alive, send R' through C.
- server authenticates the request, return 200 if credentials are correct.
The problem with win7 dav client is at step 4. above, because my server will drop the connection C in step 2, so in step 4, win 7 will NOT send R', which includes the "Authorization header", it will start over to create a new connection C', send plain request R again!
Hence the user will observe this weird "I entered username and password correctly but it always asks me again" error.
Please refer to my blog for further details: http://dark9t.github.io/blog/2014/06/02/why-digest-authentication-fails-in-windows-7-mini-redirector/
来源:https://stackoverflow.com/questions/23926497/custom-webdav-server-does-not-work-with-windows-7-mini-redirector