1

我尝试连接的网络服务的作者告诉我,我发送到他们的 Apache 网络服务器的 webdav 模块的用户名是在没有标头中的 encoding=utf-8 或 mime64 编码的情况下进入的标头是预期的,因此,上传用户的用户 ID(可能包含 Unicode 字符)不会被接受和解码。

我想知道的是,我能否以某种方式在 TidWebDAV 中设置一个属性,该属性将改变它如何进行 http 编码,从而允许对包含无法以纯 ascii 显示的 unicode 字符的用户名进行身份验证。我想也许 AuthenticationManager 属性可能与它有关。在 indy 9 文档中,它说“这个属性没有做任何事情”。它在 Indy 10 中有什么作用吗?看起来它已经实现了。

我还不明白的奥秘包括:

(1) 'logintype'(整数值)在 webdav 中有什么作用,我将其设置为什么值?目前我的代码将其设置为 3。

(2) 是否需要使用 hoForceEncodeParams 强制编码参数?

(3) 我如何以远程端可以看到的形式检查标题?

更新:正如 remy 所说,NTLM 身份验证支持 unicode 字符。我还发现您可以在基本身份验证中以“用户名:密码”形式使用 unicode utf8 mime (base64) 编码字符串。

4

1 回答 1

2

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.

于 2011-03-17T21:02:15.283 回答