用PHP如何操作LDAP
Jun 08, 2016 pm 05:33 PM1 LDAP是什么
LDAP是一個用來發(fā)布目錄信息到許多不同資源的協(xié)議。通常它都作為一個集中的地址本使用,不過根據(jù)組織者的需要,它可以做得更加強(qiáng)大。
LDAP最基本的形式是一個連接數(shù)據(jù)庫的標(biāo)準(zhǔn)方式。該數(shù)據(jù)庫為讀查詢作了優(yōu)化。因此它可以很快地得到查詢結(jié)果,不過在其它方面,例如更新,就慢得多。要非凡注重的是,LDAP通常作為一個hierarchal數(shù)據(jù)庫使用,而不是一個關(guān)系數(shù)據(jù)庫。因此,它的結(jié)構(gòu)用樹來表示比用表格好。正因為這樣,就不能用SQL語句了。
簡單說來,LDAP是一個得到關(guān)于人或者資源的集中、靜態(tài)數(shù)據(jù)的快速方式。
LDAP是輕量目錄訪問協(xié)議(Lightweight Directory Access Protocol)的縮寫,其實是一話號碼簿,類似于我們所使用諸如NIS(Network Information Service)、DNS (Domain Name Service)等網(wǎng)絡(luò)目錄,也類似于你在花園中所看到的樹木。
LDAP是一種非凡的數(shù)據(jù)庫。但是LDAP和一般的數(shù)據(jù)庫不同,明白這一點是很重要的。 LDAP對查詢進(jìn)行了優(yōu)化,與寫性能相比LDAP的讀性能要優(yōu)秀很多。
1.1 LDAP的存儲規(guī)則
區(qū)分名(DN,Distinguished Name)
和自然界中的樹不同,文件系統(tǒng)/LDAP/電話號碼簿目錄的每一片枝葉都至少有一個獨一無二的屬性,這一屬性可以幫助我們來區(qū)別這些枝葉。
在文件系統(tǒng)中, 這些獨一無二的屬性就是帶有完整路徑的文件名。比如/etc/passwd,該文件名在該路徑下是獨一無二的。當(dāng)然我們可以有/usr/passwd, /opt/passwd,但是根據(jù)它們的完整路徑,它們?nèi)匀皇俏ㄒ坏摹?br>
在LDAP中,一個條目的區(qū)分名稱叫做“dn”或者叫做區(qū)分名。在一個目錄中這個名稱總是唯一的。比如,我的dn是"uid=aghaffar, ou=People, o=developer.ch"。不可能有相同的dn,但是我們可以有諸如"uid=aghaffar, ou=Administrators, o=developer.ch"的dn。這同上面文件系統(tǒng)中/etc/passwd 和 /usr/passwd的例子很類似。
我們有獨一無二的屬性,在"ou=Administrators, o=developer.ch" 中uid和在"ou=People, o=developer.ch"中的uid。這并不矛盾。
CN=Common Name 為用戶名或服務(wù)器名,最長可以到80個字符,可以為中文;
OU=Organization Unit為組織單元,最多可以有四級,每級最長32個字符,可以為中文;
O=Organization 為組織名,可以3

Hot AI Tools

Undress AI Tool
Undress images for free

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

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

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

1. LDAP injection LDAP (Light Directory Access Portocol) is a lightweight directory access protocol based on the X.500 standard. It provides services and protocols for accessing directory databases. It is often used to form directory services with directory databases. The directory is a professional distributed database optimized for query, browsing and search. It organizes data in a tree structure, similar to the file directory in Linux/Unix systems. Data that is not modified frequently, such as public certificates, security keys, and company physical device information, is suitable for storage in the directory. LDAP can be understood as a search protocol, which is similar to SQL and has query syntax, but also has the risk of injection attacks. LDAP injection refers to the client

If the essence of sql injection is to splice strings, then the essence of everything that can be injected is to splice strings. LDAP injection is no exception as a kind of injection. What is more interesting is that it is splicing parentheses (sql injection is also concatenates parentheses, but it is more conventional to say that it concatenates strings). In the environment configuration chapter, the configuration of the ldap environment in bee-box has been discussed in great detail. The shooting range practice chapter is more about the connection process between php and ldap, the introduction of the special functions used in the middle, and some techniques for splicing parentheses. Let’s first talk about the login process of the ldap shooting range in bwapp: First, this is an LDAP login interface, the URL is http://192.168.3.184/bW

1. Overview According to my learning process, I must know what the model and vulnerability of my web attack are. Now I have encountered an unexpected situation. The first time I saw LDAP was during a penetration test in a state-owned enterprise. I found an unpopular one (authorized) and piqued my interest in it. The concept of LDAP: Full name: Lightweight Directory Access Protocol (Lightweight Directory Access Protocol), features: I won’t talk about the protocol, it’s too esoteric, it can be understood as a database for storing data, its special feature is that it is a tree A database in the form of a database. First, the name of the database is equivalent to the root of the tree (i.e. DB=dc), and then the process from the root to a leaf node is

LDAP (LightweightDirectoryAccessProtocol) is a protocol for accessing distributed directory services. It can be used for tasks such as user authentication, authorization, account maintenance, and data storage. In PHP applications, LDAP can be used as a powerful authentication mechanism to provide powerful authentication and authorization functions for applications. This article will introduce how to use LDAP for user authentication in PHP. The specific content includes: Installation and configuration L

When developing web applications using PHP, we often need to use LDAP authentication to protect application access. However, in some cases, when we try to use PHP's LDAP functionality to implement authentication, we may encounter the following error message: "PHPFatalerror:Calltoundefinedfunctionldap_bind()". This error message usually occurs when an application calls the ldap_bind() function

php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出而不是在空白頁彈出?想實現(xiàn)這樣的效果:而不是空白頁彈出:------解決方案--------------------如果你的驗證用PHP在后端,那么就用Ajax;僅供參考:HTML code

As network security issues receive more and more attention, more and more programmers are beginning to pay attention and learn how to prevent code from being attacked. Among them, common attack methods include SQL injection, XSS, CSRF, etc. However, there is another common attack method that is underestimated: LDAP injection vulnerabilities. This article will introduce the principle of this attack method and how to use PHP to prevent LDAP injection vulnerabilities. LDAP introduction LDAP (LightweightDirectoryAccessProtocol)

As the scale of enterprises and business needs continue to expand, user group management and authorization have become an essential part. LDAP (Lightweight Directory Access Protocol), as a directory service protocol widely used in enterprise networks, provides an efficient way to achieve user group management and authorization. This article will introduce how to use PHP and LDAP to implement user group management and authorization. 1. What is LDAP LDAP is a lightweight directory access protocol that is widely used as a directory service protocol in enterprise networks. LDAP is client/server based
