ldap_bind function (winldap.h)
The ldap_bind function asynchronously authenticates a client with the LDAP server. The bind operation identifies a client to the directory server by providing a distinguished name and some type of authentication credential, such as a password. The authentication method used determines the type of required credential.
WINLDAPAPI ULONG LDAPAPI ldap_bind( LDAP *ld, const PSTR dn, const PCHAR cred, ULONG method );
The session handle.
A pointer to a null-terminated string that contains the distinguished name of the entry used to bind.
A pointer to a null-terminated string that contains the credentials to use for authentication. Arbitrary credentials can be passed using this parameter. The format and content of the credentials depend on the setting of the method parameter. For more information, see the Remarks section.
The authentication method to use.
If the function succeeds, the return value is the message ID of the initiated operation.
If the function fails, it returns –1 and sets the session error parameters in the LDAP structure.
This implementation of ldap_bind supports the following authentication method.
|LDAP_AUTH_SIMPLE||Authentication with a plaintext password.||A string that contains the user password.|
LDAP_AUTH_SIMPLE is the only authentication method compatible with the asynchronous version of binding; ldap_bind. Using any other authentication method with ldap_bind will fail and return LDAP_PARAM_ERROR. Calling ldap_bind with the LDAP_AUTH_SIMPLE method is equivalent to calling ldap_simple_bind. All other authentication methods require synchronous binding as provided by ldap_bind_s.
Be aware that LDAP 2 servers require an application to bind before attempting any other operations that require authentication.
Multithreading: Bind calls are not safe because they apply to the connection as a whole. Use caution if threads share connections and, when possible, thread the bind operations with other operations.
|Minimum supported client||Windows Vista|
|Minimum supported server||Windows Server 2008|