ldap_simple_bind_s()--Perform a Simple LDAP Bind Request (Synchronous)


  Syntax
 #include <ldap.h>

 int ldap_simple_bind_s(
  LDAP   *ld,
                const char *dn,
                const char *passwd)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

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

For LDAP V2 servers, after a connection is made to an LDAP server by using the ldap_open(), ldap_init(), or ldap_ssl_init() APIs, an LDAP bind API must be called before any other LDAP APIs can be called for that connection. For LDAP V3 servers, the bind is optional.

ldap_simple_bind_s() performs a synchronous request.


Authorities and Locks

No IBM® i 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

LDAP_SUCCESS
if the request was successful.

another LDAP error
if the request was not successful.

Error Conditions

If ldap_simple_bind_s() is not successful, it returns an LDAP error code. See LDAP Client API Error Conditions for possible LDAP error code values.


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_simple_bind_s API.


Related Information



API introduced: V4R3

[ Back to top | LDAP APIs | APIs by category ]