Site icon LDAP.com

The LDAP Bind Operation

Bind operations are used to authenticate clients (and the users or applications behind them) to the directory server, to establish an authorization identity that will be used for subsequent operations processed on that connection, and to specify the LDAP protocol version that the client will use.

Authentication consists of at least two parts: identifying who or what is authenticating, and supplying some kind of proof of that identity (usually something only that user should know or have, like a static and/or password, a certificate, a hardware or software token, and/or biometric information). In many servers, there may be additional steps, like checking password policy state and other constraints that must be satisfied to allow the bind to succeed.

LDAP bind requests provide the ability to use either simple or SASL authentication. In simple authentication, the account to authenticate is identified by the DN of the entry for that account, and the proof identity comes in the form of a password. The password is transmitted without any form of obfuscation, so it is strongly recommended that simple authentication be used only over an encrypted connection (e.g., one that has been secured by SSL/TLS, or with the StartTLS extended operation). An anonymous simple bind can be performed by providing empty strings as the bind DN and password (technically, the LDAPv3 specification states that only the password must be empty, but this has been responsible for many security problems with LDAP clients in the past, and many servers require that if an empty password is provided then an empty DN must also be given).

SASL authentication uses the Simple Authentication and Security Layer, as defined in RFC 4422. SASL is an extensible framework that makes it possible to plug almost any kind of authentication into LDAP (or any of the other protocols that use SASL). SASL authentication is performed with a SASL mechanism name and an encoded set of credentials. Some SASL mechanisms may require the client and server to exchange information multiple times (via multiple bind requests and responses) in order to complete the authentication process.

An LDAP bind request includes three elements:

Note that LDAPv3 does not require clients to perform a bind operation before they can issue other types of requests to the server. If an LDAP client issues some other kind of request without first performing a bind, then the client will be considered unauthenticated. This is the same authentication state that results from an anonymous simple bind (using an empty bind DN and an empty password), and is also the authentication state that results from an unsuccessful bind operation.

When a simple bind operation completes, the server will return a basic response that includes a result code, and optional matched DN, diagnostic message, referrals, and/or response controls. A SASL bind response may also include encoded server SASL credentials for use in subsequent processing. For a SASL mechanism that requires multiple request/response cycles, all responses except the last one will include a “SASL bind in progress” result code to indicate that the authentication process has not yet completed.

Some of the most common types of results for a bind operation include:

Exit mobile version