ldap_bind(3ldap)


ldap_bind, ldap_bind_s -- LDAP bind routines

Synopsis

#include <lber.h> 
#include <ldap.h> 

int ldap_bind(LDAP *ld, char *who, char *cred, int method);

int ldap_bind_s(LDAP *ld, char *who, char *cred, int method);

Description

These routines provide an interface to the LDAP bind operation. They are defined in the LDAP API described by RFC 1823, but are deprecated in the LDAP Version 3 API. They are supplied here as a transition aid.

The method parameter is used to indicate the type of authentication used. The only currently supported value for method is LDAP_AUTH_SIMPLE. The effect of calling ldap_bind or ldap_bind_s with LDAP_AUTH_SIMPLE may also be obtained by calling ldap_simple_bind(3ldap) or ldap_simple_bind_s(3ldap).

The ld parameter is the LDAP session identifier as returned from ldap_init(3ldap) or ldap_open(3ldap).

The who parameter is the DN (distinguished name) of the user being authenticated. For an anonymous bind, the who parameter may be set to NULL or to a pointer to a null string ("").

The cred parameter is the credentials associated with the user.

Return values

ldap_bind returns the message ID of the request it sent. The result of the operation can be obtained by a subsequent call to ldap_result(3ldap). If ldap_bind fails it returns -1.

ldap_bind_s returns LDAP_SUCESS upon successful completion, otherwise an LDAP error indication (see ldap_perror(3ldap) for details).

References

Intro(3ldap), ldap_init(3ldap), ldap_open(3ldap), ldap_perror(3ldap), ldap_simple_bind(3ldap), ldap_unbind(3ldap)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.