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
function TLoginForm.Authenticate( pUser, pPassword,pDomain: WideString): Boolean;
Var
aUser,Obj : IAdsUser;
infoback : HRESULT;
begin
Try
CoInitialize(nil);
infoback := 0;
infoback := ADsOpenObject(Format('LDAP://%s',[pDomain]),Format('%s',[pUser]),pPassword,ADS_USE_SSL,IAds,aUser);
CoUninitialize;
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;
Thanks in Advance