Does indy 10 TIdWebDav support authentication of users that have unicode characters in the user name?

StackOverflow https://stackoverflow.com/questions/5344790

Question

The author of a web-service that I am trying to connect to, tells me that the user name I am sending to their Apache web server's webdav module, is coming in without the encoding=utf-8 in the headers, or that mime64 encoding is expected for the headers, and thus, the uploading user's userid, which can contain unicode characters, is not being accepted and decoded.

What I want to know is, can I somehow set a property in TidWebDAV that will change how it does the http encoding, in a way that will allow authentication of a user name that contains unicode characters that can't be shown in plain ascii. I thought maybe the AuthenticationManager property might have something to do with it. In indy 9 documetnation, it says "this property doesn't do anything". Does it do something in Indy 10? It looks like it's implemented.

Mysteries I don't yet understand include:

(1) What does 'logintype' (with integer value) do in webdav, and what values do I set it to? Currently the code I have sets it to 3.

(2) Do I need to force encoding params with hoForceEncodeParams?

(3) How do I inspect the headers in the form that the remote side will see them?

Update: As remy says, NTLM authentication supports unicode characters. I also found that you can use unicode utf8 mime (base64) encoded strings in Basic Authentication, in "username:password" form.

Was it helpful?

Solution

The purpose of TIdAuthenticationManager is to keep a cache of authentication parameters are used to successfully log in to particular URLs. Nothing more. TIdHTTP does not make use of that cache during authentication, but you can utilize it yourself in the OnSelectAuthentication and OnAuthentication events, if desired.

Which authentication scheme is actually being used in this situation? Which header(s) is the webdav module expecting the character encoding to be specified in? In Indy 10, the NTLM classes support Unicode strings during hashing, but they use UTF-16, not UTF-8.

Can the webdav author provide more info about what he is actually expecting from you?

To answer your other questions:

(1) What 'logintype' are you referring to? There is no such property or parameter in Indy.

(2) hoForceEncodeParams only applies when calling Post() to send a TStrings object for 'application/x-www-form-urlencoded' requests. It has no effect on authentication.

(3) To see what data is being transmitted back and forth over the connection, you can attach a TIdLog... component, such as TIdLogFile or TIdLogEvent, to the Intercept property. Or else use an external packet sniffer, such as Wireshark.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top