ldap
Table of Contents
Lightweight Directory Access Protocol
Le protocole d'annuaire.
Introduction
- A System Administrator's View of LDAP by Bruce Markey, oct 1997
- Introduction to LDAP: courte et bien
- survol de LDAP, oct 1999
- http://www.openldap.org/ OpenLDAP, une implémentation libre de LDAP
Lectures
- Where are the 'Modern' Directory Services?, Slashdot 18/02/05
Migration de l'authentification des utilisateurs
Au cas où ça me botterait un jour d'avoir une DB centralisée…
Projet: address book
Faire un petit annuaire LDAP pour moi hébergé sur mon serveur :)
Documentation
- A (nearly) complete Address Book example avec ACLs
- Using LDAP for mail contacts, 18/05/05
- OpenLDAP as an Address Book avec les instructions pour mutt
Je me lance avec ce tutoriel: addressbook
Logiciels
Browsers LDAP
- http://gq-project.org/ un browser GTK
Outils de gestion de l'annuaire
-
- ConTagged: a l'air bien
- Turba Contact Manager de la suite Horde: un peu lourd
- phpLDAPadmin: pas très spécifique
- http://sourceforge.net/projects/labe/ pas actif
- http://ldap-abook.sourceforge.net/ plus maintenu depuis 2001
- MacOS X
Schemas LDAP
- inetperson.schema est défini dans la RFC 2798
Test en PHP
<?php // Test ldap connection. $ldap_host='ldap.example.com'; $ldap_basedn='dc=example,dc=com'; $ldap_use_start_tls=false; $ldap_binddn=''; $ldap_bindpw=''; ini_set('html_errors','off'); header('Content-Type: text/plain'); echo "LDAP query test\n"; echo "Connecting ...\n"; $ds=ldap_connect($ldap_host); // must be a valid LDAP server! echo "connect result is " . $ds . "\n"; if ($ds) { if (ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { echo "Using LDAPv3\n"; } else { echo "Failed to set protocol version to 3\n"; } if ($ldap_use_start_tls) { echo "Enabling StartTLS\n"; echo "Result is "; var_dump(ldap_start_tls($ds]]; } echo "Binding"; if ($ldap_binddn!='') { echo " with authenticated bind ...\n"; $r = ldap_bind($ds,$ldap_binddn,$ldap_bindpw); } else { echo " with anonymous bind ...\n"; $r=ldap_bind($ds); } echo "Bind result is " . $r . "\n"; echo "Searching for (cn=*) ...\n"; // Search surname entry $sr=ldap_search($ds, $ldap_basedn, "cn=*"); echo "Search result is " . $sr . "\n"; echo "Number of entires returned is " . ldap_count_entries($ds, $sr) . "\n"; echo "Getting entries ...\n"; $info = ldap_get_entries($ds, $sr); echo "Data for " . $info["count"] . " items returned:\n"; for ($i=0; $i<$info["count"]; $i++) { echo "dn is: " . $info[$i]["dn"] . "\n"; echo "first cn entry is: " . $info[$i]["cn"][0] . "\n"; echo "first email entry is: " . $info[$i]["mail"][0] . "\n------\n"; } echo "Closing connection\n"; ldap_close($ds); } else { echo "Unable to connect to LDAP server\n"; } ?>
( source attachment test-ldap.php tout en bas)
ldap.txt · Last modified: 2013/01/30 17:51 by 127.0.0.1