ldap_bind_s()--Perform an LDAP Bind Request (Synchronous)




Syntax

#include <ldap.h>
 
int ldap_bind_s(
       LDAP            *ld,
       char            *dn,
       char            *cred,
       int             method)




Threadsafe: Yes

The ldap_bind_s() function provide synchronous general authentication routines, where in principle an authentication method can be chosen. In this toolkit, method must be set to LDAP_AUTH_SIMPLE.

The ldap_bind_s() 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_bind_s() is synchronous request.

Since this APIs is deprecated, ldap_simple_bind_s() should be used instead.

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.

cred
(Input) Specifies the credentials with which to authenticate. Arbitrary credentials can be passed using this parameter. In most cases, this is the user's password.

method
(Input) Selects the authentication method to use. Specify LDAP_AUTH_SIMPLE for simple authentication. Simple authentication is the only supported method.

Note that use of the ldap_bind_s() APIs is deprecated.

Return Value

LDAP_SUCCESS
if the request was successful.
another LDAP error code
if the request was not successful.

Error Conditions

ldap_bind_s() will return LDAP error code if not successful. See LDAP Client API Error Conditions for possible LDAP error code values.

Error Messages

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

Related Information

    ldap_bind() -- Asynchronously 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() -- Asynchronously bind to the directory using simple authentication.
    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]