Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How can I authenticate a Windows domain user in Delphi? using ActiveDs_TLB


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0 Threads: [ Previous | Next ]
Asgar Ahamed

Posts: 2
Registered: 11/23/13
How can I authenticate a Windows domain user in Delphi? using ActiveDs_TLB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 8, 2016 5:54 AM
I am trying to authenticate windows domain user in Delphi. I used the code below. If I use ADS_SECURE_AUTHENTICATION, it says

Logon failure: unknown user name or bad password

If i use ADS_USE_SSL it is saying

An invalid dn syntax has been specified

if i don't pass username and password it is binding successfully.

pDomain := 'ldapserverfullyqualifiedname:636/cn=U129752,ou=FRA,ou=INDAS,ou=LH,o=LH-DIR';

function TLoginForm.Authenticate( pUser, pPassword,pDomain: WideString): Boolean;
Var
aUser,Obj : IAdsUser;
infoback : HRESULT;
begin
Try

infoback := 0;

infoback := ADsOpenObject(Format('LDAP://%s',[pDomain]),Format('%s',[pUser]),pPassword,ADS_USE_SSL,IAds,aUser);

Result := true;
ShowMessage('Success');
// here retrieve the information needed
Except
On E:Exception do
Begin
Result := false;
ShowMessage(E.Message);
aUser := Nil;
End;
End
end;
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02