ldap_simple_bind()--Perform a Simple LDAP Bind Request




Syntax

#include <ldap.h>

int ldap_simple_bind(
		LDAP 		*ld,
                char 		*dn,
                char 		*passwd)



Threadsafe: Yes

The ldap_simple_bind() function is used to authenticate a distinguished name (DN) to a directory server.

After a connection is made to an LDAP server by using the ldap_open() API, an LDAP bind API must be called before any other LDAP APIs can be called for that connection.

ldap_simple_bind() is an asynchronous request. The result of the operation can be obtained by a subsequent call to ldap_result().

Authorities and Locks

No OS/400 authority is required. All authority checking is done by the LDAP server.

Parameters

ld
(Input) Specifies the LDAP pointer returned by a previous call to ldap_init(),ldap_ssl_init(), or ldap_open().
dn
(Input) Specifies the Distinguished Name of the entry to bind as.
passwd
(Input) Specifies the password used in association with DN of the entry in which to bind.

Return Value

Message ID of the Operation Initiated
if the request was successful. A subsequent call to ldap_result(), can be used to obtain the result.
-1
if the request was not successful, setting the session error parameters in the LDAP structure appropriately, which can be obtained by using ldap_get_errno().

Return Value

Message ID of the Initiated Request
if the request was successful.
-1
if the request was not successful.

Error Conditions

If ldap_simple_bind() is not successful, -1 will be returned setting the session error (ld_errno) parameters in the LDAP structure appropriately. See LDAP Client API Error Conditions for possible LDAP error code values. Use ldap_get_errno() to obtain the error code ld_errno.

Error Messages

    The following message may be set from this function.
    CPF3CF2 E  Error(s) occurred during running of ldap_simple_bind API.

Related Information

    ldap_bind() -- Asynchronously bind to the directory (deprecated).
    ldap_bind_s() -- Synchronously bind to the directory (deprecated).
    ldap_sasl_bind() -- Asynchronously bind to the directory using SASL.
    ldap_sasl_bind_s() -- Synchronously bind to the directory using SASL.
    ldap_simple_bind_s() -- Synchronously bind to the directory using simple authentication.
    ldap_unbind() -- Asynchronously unbind from the LDAP server and close the connection.
    ldap_unbind_s() -- Synchronously unbind from the LDAP server and close the connection.
    ldap_set_rebind_proc() -- Sets the entry-point of a routine during the chasing of referrals.


Top | LDAP APIs List
APIs by category

[Information Center Home Page | Feedback ] [Legal | AS/400 Glossary]