What is ldap?
LDAP stands for Lightweight Directory Access Protocol. It is a set of rules (a protocol) that lets computers talk to a directory service-a special kind of database that stores information about users, groups, devices, and other resources in a network. Think of it as a phone book for an organization, where you can look up a person’s email, login name, or which computers they can access.
Let's break it down
- Directory vs. Database: A directory is optimized for read‑heavy operations (searching and retrieving data) and is organized in a hierarchical tree (like folders inside folders).
- Lightweight: LDAP is “lightweight” because it uses a simple, efficient format (based on the older X.500 standard) and runs over TCP/IP, making it fast and easy to implement.
- Protocol: It defines how clients (like a login screen) send requests (search, add, modify, delete) to the server and how the server replies.
- Entries: Each item in the directory is called an entry, identified by a unique DN (Distinguished Name) such as
uid=jdoe,ou=People,dc=example,dc=com
. - Attributes: An entry contains attributes (e.g.,
cn
for common name,mail
for email) that hold the actual data.
Why does it matter?
- Centralized Management: One place to store user credentials and permissions, so admins don’t have to maintain separate login lists for each application.
- Single Sign‑On (SSO): Users can log in once and access many services that trust the LDAP directory.
- Scalability: Designed to handle thousands or millions of entries with fast search performance.
- Standardization: Many operating systems, email servers, and enterprise apps already understand LDAP, reducing integration effort.
Where is it used?
- Corporate networks for authenticating employees to Windows domains (Active Directory uses LDAP).
- Email systems (e.g., Microsoft Exchange, OpenLDAP) to look up user mailboxes.
- VPN and Wi‑Fi access points that need to verify user credentials.
- Web applications that delegate login to an LDAP server instead of a custom database.
- Cloud services that sync on‑premises directories to the cloud (Azure AD Connect, Okta).
Good things about it
- Speed: Optimized for quick read/search operations.
- Interoperability: Works across different platforms and languages; many libraries exist.
- Security: Supports TLS/SSL encryption (LDAPS) and SASL mechanisms for strong authentication.
- Flexibility: Can store a wide variety of data types and be extended with custom schemas.
- Reliability: Mature, battle‑tested technology with robust replication and failover features.
Not-so-good things
- Complex Setup: Initial configuration, schema design, and replication can be tricky for beginners.
- Write‑Heavy Limitations: Not ideal for applications that need frequent updates; it’s read‑optimized.
- Limited Query Language: LDAP filters are less expressive than SQL, making complex queries harder.
- Security Missteps: If not properly secured (e.g., no TLS), credentials can be exposed.
- Vendor Lock‑In: Some implementations (like Microsoft Active Directory) add proprietary extensions that reduce portability.