TWebBrowser 和 NTLM 身份验证
如何使用 Delphi 中的 TWebBrowser 组件从 ADS 域外部连接到 Sharepoint 服务器?我已在我的域中创建了一个用户帐户,并将使用此信息连接到服务器。
以下代码不起作用:
const
USERNAME = '[email protected]';
PASSWORD = 'Password2009';
var
Url, Headers: OleVariant;
begin
URL := 'http://192.168.100.130';
Headers := 'Authorization: NTLM ' +
Base64Encode(USERNAME + ':' + PASSWORD)+ sLineBreak;
WebBrowser1.Navigate2(Url, EmptyParam, EmptyParam, EmptyParam, Headers);
使用 Basic-Auth 具有相同(不起作用)的结果。
How can I connect with the TWebBrowser-component in Delphi from outside an ADS-Domain to a Sharepoint-Server? I've created an user-account in my domain and will connect with this information to the server.
The following code doesn't work:
const
USERNAME = '[email protected]';
PASSWORD = 'Password2009';
var
Url, Headers: OleVariant;
begin
URL := 'http://192.168.100.130';
Headers := 'Authorization: NTLM ' +
Base64Encode(USERNAME + ':' + PASSWORD)+ sLineBreak;
WebBrowser1.Navigate2(Url, EmptyParam, EmptyParam, EmptyParam, Headers);
with Basic-Auth the same (not working) result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我们的 Intranet 和 Indy TIdHTTP 组件中,我使用它作为用户名:
它也适用于 FireFox,其中 NTLM 安全服务器不会像 IE 那样在登录对话框中导致“域”输入字段,而只会导致默认用户/密码输入字段。
In our Intranet and with the Indy TIdHTTP component I used this for the username:
It also worked in FireFox where the NTLM secured server will not cause a 'Domain' input field in the login dialog like in IE, but only the default user / password input fields.
当您提到此调用失败时,为什么不在 SharePoint/IIS 端检查记录了哪些错误?如果是 401.1 错误,安全事件日志应包含登录失败记录并告诉您原因。 (必须通过本地安全策略在服务器上启用登录失败审核。)
When you mentioned this call failed, why not check on SharePoint/IIS side what error was recorded? If it was a 401.1 error, Security event log should contain a Logon Failure record and tell you the reason. (Logon audit for failure must be enabled on the server via Local Security Policy.)