ldap_simple_bind(3ldap)


ldap_simple_bind, ldap_simple_bind_s -- LDAP bind routines

Synopsis

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

int ldap_simple_bind(LDAP *ld, char *who, char *passwd);

int ldap_simple_bind_s(LDAP *ld, char *who, char *passwd);

Description

These routines provide an interface to the LDAP bind operation using simple or no authentication. After an association is made to an LDAP server using ldap_init(3ldap) or ldap_open(3ldap), an LDAP bind operation must be performed before other operations can be attempted over the conection.

Simple authentication, if used, sends a cleartext password to the LDAP server.

The ld parameter is the LDAP session identifier as returned from ldap_init or ldap_open.

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 passwd parameter is the password associated with the user. If no password is required or an anonymous bind is being performed, the passwd parameter should be set to NULL or to a pointer to a null string ("").

Return values

ldap_simple_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_simple_bind fails, it returns -1.

ldap_simple_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_unbind(3ldap)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.