LDAP (Lightweight Directory Access Protocol
LDAP is the standard TCP/IP stack protocol that is used to store and query information from a hierarchical directory. It is an alternative to X.500 Directory service protocol which is more resource-intensive. LDAP is often used for SSO authentication and storage. By standard LDAP uses TCP port 389 for unencrypted communication and TLS port 636 over an encrypted channel.
How Does LDAP work?
- Client starts an LDAP session through the dedicated TCP port.
- (Optional) Read and modify the session option values.
- Establish a connection to the LDAP server or explicitly bind to the server with a privileged authenticated client using one of the binding functions.
- Submit a query to an email server or establish a connection to a printer. The server receives the query and returns the corresponding information to the user.
- After completion, close the connection to the LDAP server.
LDAP unlike most modern http-based protocols, uses persistent connections which can live for days when communication with a directory server.
Advantages of Using LDAP
- It is a mature protocol which keeps on evolving. It is a critical component of most large enterprises therefore the need to maintain revisions and update standards of the protocol.
- LDAP is a lightweight version of the X.500 protocol but is also very lightweight compared to other modern day protocols.
- LDAP is secure and is often used to store usernames, passwords and other sensitive information. But its security is subject to its implementation. It is important to follow best practices when adopting this protocol such as:
- establishing an access control policy.
- maintaining multiple copies of the directory data.
- encrypting sensitive information such as passwords.
Components of LDAP
Attribute: the data in the LDAP system is stored in key-value pairs known as attributes. You can set an attributes value by separating the name and the value using a colon and a space. e.g.
mail: johndoe@gmail.com
Use an equal's sign to refer to an attribute and its data without setting it. e.g.
mail=johndoe@gmail.com
The most commonly used attributes include:
- ou: Organizational Unit
- _ dn_: distinguished name
- cn: common name
- description
- dc: domain component
- givenName: first name
- mail: e-mail address
- sn: surname
Entries: an entry is a collection of attributes which are associated to or describe something. An entry could be a user in your system. Think of it as a row in a relational database. Each entry consists of:
- a distinguished name (uniquely identifies a specific entry in the DIT hierarchy
- a collection of attributes (they hold the data for the entry)
- a collection of object classes (they indicate what kind of object an entry represents e.g. information about a device or person)
dn: ou=Users,dc=example,dc=com,uid=jd001 objectClass: EntUsers cn: Jane Doe sn: Doe mail: jdoe@example.com uid: jd001
Search Filters: used to define the criteria for identifying entries that contain certain kinds of information.
LDAP URLS: this URL contains different pieces of information that can reference a directory server or a search criteria.
Primary Operators of LDAP
- Add: Insert a new entry into the directory.
- Modify: change existing directory entries.
- Bind: authenticate and connect the LDAP client to the server.
- Delete: Remove directory entries.
LDAP is used by Microsoft's Active Directory and other directory servers such as OpenLDAP and Red Hat Directory Server. To setup LDAP within an enterprise, you need a directory server, users with different permissions, directory data that can be queried and an LDAP client application.
-
The above is the detailed content of LDAP (Lightweight Directory Access Protocol. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Python is suitable for data science, web development and automation tasks, while C is suitable for system programming, game development and embedded systems. Python is known for its simplicity and powerful ecosystem, while C is known for its high performance and underlying control capabilities.

Python excels in gaming and GUI development. 1) Game development uses Pygame, providing drawing, audio and other functions, which are suitable for creating 2D games. 2) GUI development can choose Tkinter or PyQt. Tkinter is simple and easy to use, PyQt has rich functions and is suitable for professional development.

You can learn basic programming concepts and skills of Python within 2 hours. 1. Learn variables and data types, 2. Master control flow (conditional statements and loops), 3. Understand the definition and use of functions, 4. Quickly get started with Python programming through simple examples and code snippets.

You can learn the basics of Python within two hours. 1. Learn variables and data types, 2. Master control structures such as if statements and loops, 3. Understand the definition and use of functions. These will help you start writing simple Python programs.

Python is easier to learn and use, while C is more powerful but complex. 1. Python syntax is concise and suitable for beginners. Dynamic typing and automatic memory management make it easy to use, but may cause runtime errors. 2.C provides low-level control and advanced features, suitable for high-performance applications, but has a high learning threshold and requires manual memory and type safety management.

To maximize the efficiency of learning Python in a limited time, you can use Python's datetime, time, and schedule modules. 1. The datetime module is used to record and plan learning time. 2. The time module helps to set study and rest time. 3. The schedule module automatically arranges weekly learning tasks.

Python is widely used in the fields of web development, data science, machine learning, automation and scripting. 1) In web development, Django and Flask frameworks simplify the development process. 2) In the fields of data science and machine learning, NumPy, Pandas, Scikit-learn and TensorFlow libraries provide strong support. 3) In terms of automation and scripting, Python is suitable for tasks such as automated testing and system management.

Python excels in automation, scripting, and task management. 1) Automation: File backup is realized through standard libraries such as os and shutil. 2) Script writing: Use the psutil library to monitor system resources. 3) Task management: Use the schedule library to schedule tasks. Python's ease of use and rich library support makes it the preferred tool in these areas.
