LDAP e' un Directory Service ovvero un database specializzato (tipicamente per in Naming) e orientato alla lettura.
E' composto da un insieme di Entry organizzate in modo gerarchico.
Ogni entry si compone di un set di attribuiti di tipo nome=valore.
Esempi di attributi piu' comuni:
c (Country) - o (Organization) - ou (Organizational Unit) cn (Common Name) - dc (Domain Component)
Esempio di Gerarchia:
c=it o=miaditta ou=dipendenti cn=Mario Rossi cn=Giorgio Bianchi ou=ospiti cn=Pinco Palla
Ogni attributo e' identificato univocamente dal Distinguished Name (DN). Ad esempio il DN di Mario Rossi:
"cn=Mario Rossi, ou=dipendenti, o=miaditta, c=it"
Doc: OpenLDAP Software 2.3 Administrator's Guide
Esempi ldapsearch:
ldapsearch -h didattica.fis.unipr.it -x s sub -b "ou=Users,ou=lpr,dc=fis,dc=unipr,dc=it" -D "cn=browser,dc=fis,dc=unipr,dc=it" -W matricola
Software: Ldap Browser - LDAP admin (win)
Ogni Entry contiene un insieme di ObjectClass che stabiliscono quali attributi devono (MUST) o possono (MAY) far parte della Entry. Ad esempio l'ObjectClass "Person" definisce gli attributi di una Persona:
objectclass ( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $ description ) )
http://www.alvestrand.no/objectid/2.5.6.6.html
Un LDAP schema raccoglie le definizioni di tutti gli attribuiti e tutte le Objectclass relative un determinato argomento.
Per garantire l'univocita' di Attributi ed ObjectClass esiste uno spazio dei nomi, gestito dagli Organismi internazionali ISO e ITU, in cui ad ogni Attributo e ad ogni ObjectClass viene assegnata una stringa numerica univoca detta OID.
Esistono 3 OID "TopLevel":
0 (ITU-T) 0.0(recommend.) 0.1(question) 0.2(admin) 0.4(identified.org) 0.9(data) 1 (ISO) 1.0 (standard) 1.2(member body) 1.3 (identified.org) 2 (ITU-T & ISO) 2.1(ASN.1) 2.2(assoc. control) 2.3(reliable transf) 2.4remote oper.) 2.5(X.500) 2.6(X.400) 2.16(joint assign by country) 2.23(internat.org)
OID: esempi di Gerarchia:
Labeled URI: 1 ISO 1.3 ISO Idetified Org 1.3.6 US Depart Defense 1.3.6.1 Internet 1.3.6.1.4 Internet private 1.3.6.1.4.1 Registered Private Enterprises 1.3.6.1.4.1.250 Univ. Michigan 1.3.6.1.4.1.250.1 Attribute type 1.3.6.1.4.1.250.1.57 labeledURI Attribute Type 1.3.6.1.4.1.8005 EDG (Eu-DataGrid) 1.3.6.1.4.1.8005.100 Glue Top 1.3.6.1.4.1.8005.100.2.1.3 GlueCeTop Objectclass Descrizione in RFC 2079: Schema Definition of the labeledURI Attribute Type Name: labeledURI ShortName: None Description: Uniform Resource Identifier with optional label OID: umichAttributeType.57 (1.3.6.1.4.1.250.1.57) Syntax: caseExactString SizeRestriction: None SingleValued: False
OID esempio account:
objectclass ( 1.3.6.1.1.1.2.0 NAME 'posixAccount' SUP top AUXILIARY DESC 'Abstraction of an account with POSIX attributes' MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $ description ) )
objectclass ( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' SUP top AUXILIARY DESC 'Additional attributes for shadow passwords' MUST uid MAY ( userPassword $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ shadowInactive $ shadowExpire $ shadowFlag $ description ) )
objectclass ( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' DESC 'RFC2798: Internet Organizational Person' MAY ( audio $ businessCategory $ carLicense $ departmentNumber $ displayName $ employeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddress $ initials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ pager $ photo $ roomNumber $ secretary $ uid $ userCertificate $ x500uniqueIdentifier $ preferredLanguage $ userSMIMECertificate $ userPKCS12 ) )