ldapBind(3ibx) — Subroutines
NAME
ldapBind − Creates an association between an LDAP client application and an LDAP-compliant server, and optionally provides identification information about the user requesting the look-up.
SYNOPSIS
| #include <libldap.h> | ||
| int ldapBind( | LDAP_t ∗ldap_handle, | |
| char ∗distinguished_name, | ||
| char ∗password, | ||
| int auth_level ); |
INPUT PARAMETERS
ldap_handleThe address of an LDAP handle.
distinguished_nameThe address of a buffer containing the distinguished name of a user who is requesting the look up, or a NULL address, if you want the client to bind with the server using a default user name. The following is an example of an LDAP-compliant distinguished name:
(cn="Joan Smith", ou=marketing, o="Big Corporation", c=us)
passwordThe address of a buffer containing the X.500 password for the distinguished_name user, or NULL if you want to bind using a default password or if you want to bind allowing access only to world readable directory entries.
auth_levelThe X.500 authentication level for the user’s access. (You must specify the LDAP_AUTH_SIMPLE constant. For more information on unsupported constants that represent authorization levels, see the libldap.h file.)
DESCRIPTION
Call the ldapBind function after you have initialized the LDAP handle with a call to the ldapOpen function.
If the user issues look-up commands that require a check on the person’s X.500 privileges (such as a system administrator who may be allowed to change entry attributes that most users are not allowed to change), then you need to specify the person’s distinguished name, password, and authentication level. Otherwise, to use default privileges, which usually allow people access to world readable directory attributes, pass NULL addresses to these parameters.
RETURNS
One of the LDAP standard return values: LDAP_message.
RELATED INFORMATION
Functions: ldapOpen(3), ldapUnBind(3).