LDAP: How an App Finds One Record in a Directory
A staff directory can hold thousands of names, phone numbers and email addresses. An application usually needs only a small piece of it: the address for one colleague, perhaps, or the members of one group. LDAP gives software a common way to ask the directory for that information.
Lightweight Directory Access Protocol, or LDAP, defines the requests and replies exchanged between a client and a directory server. A client can search for records and, with permission, add or change them.
The server holds and manages the directory; LDAP is how the client talks to it. OpenLDAP is one implementation. Microsoft Active Directory also uses LDAP, alongside other functions.
Active Directory in Five Minutes
A directory record has an address of its own
Consider an employee named Maya Singh. Her directory entry might include several attributes: her account name, email address and telephone number. An attribute names a kind of information; its value holds the particular detail.
Entries sit in a hierarchy, with one branch containing entries beneath it. Suppose Maya's company keeps employee entries in a branch called People. Her distinguished name, or DN, identifies her entry within the directory's structure, much like a full address.
The directory also has a schema, a set of rules governing the kinds of information its entries can hold. These parts give clients a consistent structure to work with, as the OpenLDAP introduction explains.
Now suppose an office application needs Maya's email address. Its LDAP search can specify:
- Where in the directory to begin, called the base.
- How far through that branch to look, called the scope.
- Which entries match its conditions, expressed in a filter. Here, it could look for Maya's account name.
- Which attributes to return, in this case the email address.
The application can ask for just that attribute instead of fetching every detail about everyone in the organization. The directory still applies its permissions and limits before returning results. LDAP carries the lookup and answer; the application uses the address it receives.
Reading an entry and changing it are different requests
LDAP also defines operations to add, modify, delete and compare directory information. A staff address book may need to read Maya's telephone number. A tool used to maintain employee records may need to change it. Those tasks need different permissions.
An LDAP Bind operation helps establish the connection's identity and access state. Depending on the method, the client may supply a name and password, use another way to authenticate or establish an anonymous connection. Authentication checks identity; authorization determines what that identity may do.
That distinction continues after a successful sign-in. An authenticated account might be able to find a person's public contact details while being unable to read other attributes or edit the entry.
- Keep every photo and file on a box you own, and reach them from anywhere.
- Let backups run on their own so one dead laptop doesn't take your files with it.
- Add two drives and a failed disk no longer means lost files.
Protecting the exchange
A simple name-and-password exchange needs confidentiality so someone observing the connection cannot read the credentials. Transport Layer Security, or TLS, can provide that protection. LDAP's StartTLS operation adds TLS to an existing connection; OpenLDAP also supports connections that begin with TLS, commonly called LDAPS.
The client must verify the server's identity and insist on the intended protection. A client that requests TLS but carries on when it fails may send information without the protection it expected. OpenLDAP's TLS documentation describes this difference in client behavior.
An application using LDAP to check passwords can also misread a successful Bind. Anonymous and unauthenticated forms exist, so “success” does not always mean a password was verified. The authentication specification warns about clients accepting a successful empty-password Bind as a successful user login. Treating the two results as equivalent could let someone through the login screen without a checked password.
Active Directory Forests: Why Separate Domains Still Share Risk

Kerberos: How Tickets Take the Place of Repeated Passwords

Identity and Access Management: Who Gets to Do What?

QUOTE:
"Amateurs hack systems, professionals hack people."
