TWebBrowser and NTLM authentication

How can I connect with TWebBrowser component in Delphi from outside ADS domain to Sharepoint server? I created a user account in my domain and will connect this information to the server.

The following code doesn't work:

const
USERNAME = 'JamesBond@domain.tld';
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.

+2


source to share


2 answers


On our intranet and Indy TIdHTTP component, I used this for the username:

Username := "domainname\username";

      



It also worked in FireFox where the secure NTLM server will not call the "Domain" input field in the login dialog like in IE, but only the default input / password fields.

0


source


When you mentioned that this call failed, why not check on the SharePoint / IIS side which error was logged? If it was a 401.1 error, the security event log should contain a record of the login failure and give the reason. (Logon auditing for failure must be enabled on the server using a local security policy.)



0


source







All Articles