WebDavClient icon indicating copy to clipboard operation
WebDavClient copied to clipboard

digest authentication

Open ningma97 opened this issue 6 years ago • 2 comments

Hi, I have a WebDAV server which uses the digest method for authentication.

This appears a problem for WebDavClient. Any advice on how to change WebDavClientParams to use digest credentials?

The error I got is:

{PROPFIND WebDAV response - StatusCode: 417, Description: Expectation Failed}

Many thanks Ning

ningma97 avatar Aug 13 '18 21:08 ningma97

Hi Ning,

I haven't used digest auth with WebDavClient but I hope this case is supported. Try passing CredentialCache as credentials. Under the hood these credentials are passed to HttpClientHandler.Credentials (https://github.com/skazantsev/WebDavClient/blob/master/src/WebDav.Client/WebDavClient.cs#L778:L782)

This SO topic can be helpful: https://stackoverflow.com/questions/10658202/httprequestmessage-and-digest-authentication

Let me know if it helps.

skazantsev avatar Aug 14 '18 08:08 skazantsev

I encounter the same problem. Interestingly, it only is a problem on Xamarin.iOS, while it works fine in UWP. Xamarin.iOS apparently uses Basic Authentication by default and when trying to force Digest authentication with the CredentialCache directly as you suggested, it didn't work either (or at least, not reliably). Maybe this is a bug on Xamarin.iOS as no Authorization header is set when inspecting the packages in Fiddler.

Would you be able to implement this workaround into the library? https://stackoverflow.com/a/10179991/3585218

tipa avatar Aug 26 '19 11:08 tipa