# Delphi problem with WinLDAP



## alan_warren (Aug 9, 2005)

I am attempting to connect to the active directory of a domain controller. Upon calling the WinLDAP method ldap_bind_s with the credentials of the domain administrator and using LDAP_AUTH_NTLM as the authorisation mode, I get the error "invalid credentials".

Microsoft's help on ldap_bind_s states that its third parameter can be a pointer to the SEC_WINNT_AUTH_IDENTITY structure, which allows greater control in the way the client binds to the active directory. Unfortunately I cannot find any reference on the web to using the SEC_WINNT_AUTH_IDENTITY structure in Delphi.

Does anyone know how to use it with Delphi, or whether it is even available to Delphi developers?

Any help will be much appreciated. Thanks.


----------



## GCDude (Apr 1, 2005)

heres the structure, 

For Windows NT, Windows 2000, Windows 9x, and Apple Macintosh:

typedef struct _SEC_WINNT_AUTH_IDENTITY 
{
unsigned short __RPC_FAR *User;
unsigned long UserLength;
unsigned short __RPC_FAR *Domain;
unsigned long DomainLength;
unsigned short __RPC_FAR *Password;
unsigned long PasswordLength;
unsigned long Flags;
} SEC_WINNT_AUTH_IDENTITY, *PSEC_WINNT_AUTH_IDENTITY;

but im a VC++ developer with no idea of Delphi


----------

