Annuaires (Directory)



Documents pareils
Didier Donsez

Java Naming and Directory Interface

Utiliser Améliorer Prêcher. Introduction à LDAP

Institut Supérieur de Gestion. Cours pour 3 ème LFIG. Java Enterprise Edition Introduction Bayoudhi Chaouki

SQL Server et Active Directory

et Active Directory Ajout, modification et suppression de comptes, extraction d adresses pour les listes de diffusion

Architecture JEE. Objectifs attendus. Serveurs d applications JEE. Architectures JEE Normes JEE. Systèmes distribués

Supervision et infrastructure - Accès aux applications JAVA. Document FAQ. Page: 1 / 9 Dernière mise à jour: 15/04/12 16:14

Cedric Dumoulin (C) The Java EE 7 Tutorial

Groupe Eyrolles, 2004 ISBN :

INSTALLATION ET CONFIGURATION DE OPENLDAP

Introduction aux «Services Web»

Description de la maquette fonctionnelle. Nombre de pages :

DUT. Vacataire : Alain Vidal - avidal_vac@outlook.fr

1 Introduction à l infrastructure Active Directory et réseau

Plan. Department of Informatics

Introduction aux annuaires d entreprise LDAP

Intranet / Groupware LORIA - Université d automne Intranet/Groupware - L. Mirtain 1

LDAP : concepts, déploiement

Annuaires LDAP et méta-annuaires

A. À propos des annuaires

Projet. But: consultation en temps réel d événements (cours de bourse, trafic d envoi SMS ) sur des téléphones portables. Serveur de diffusion

Environnements de Développement

Cours Master Recherche RI 7 Extraction et Intégration d'information du Web «Services Web»

Systèmes répartis. Fabrice Rossi Université Paris-IX Dauphine. Systèmes répartis p.1/49

Déploiement de (Open)LDAP

LDAP : concepts, déploiement

EXA1415 : Annotations

Principes. 2A-SI 3 Prog. réseau et systèmes distribués 3. 3 Programmation en CORBA. Programmation en Corba. Stéphane Vialle

Evidian IAM Suite 8.0 Identity Management

OpenLDAP, un outil d administration Réseau. Une implémentation d OpenLDAP

Méta-annuaire LDAP-NIS-Active Directory

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

Le protocole LDAP. Formation. Administration et sécurité. Auteurs : Clément OUDOT, Raphaël OUAZANA et Sébastien BAHLOUL

Once the installation is complete, you can delete the temporary Zip files..

LDAP : pour quels besoins?

Windows 2000 Server Active Directory

DNS. Olivier Aubert 1/27

Programmation Web Avancée Introduction aux services Web

OpenLDAP. Astuces pour en faire l'annuaire d'entreprise idéal THÈME TECHNIQUE - ADMINISTRATION SYSTÈME. Jonathan CLARKE - jcl@normation.

Active Directory. Structure et usage

Service d annuaire LDAP JRES 99 - LDAP - L. Mirtain - LORIA-INRIA 1

Remote Method Invocation (RMI)

S28 - La mise en œuvre de SSO (Single Sign On) avec EIM (Enterprise Identity Mapping)

Présentation de Active Directory

Introduction à la plateforme J2EE

Le cadre des Web Services Partie 1 : Introduction

Catalogue des Formations Techniques

Architectures web/bases de données

Instructions Mozilla Thunderbird Page 1

L annuaire et le Service DNS

PRODUCTS LIST (updated 11th January 2010)

Sun Java System Access Manager Notes de version pour Microsoft Windows

MODULE I1. Plan. Introduction. Introduction. Historique. Historique avant R&T 1ère année. Sylvain MERCHEZ

Java et les bases de données

Remote Method Invocation en Java (RMI)

OpenPaaS Le réseau social d'entreprise

JOnAS 5. Serveur d application d

Conférence technique sur Samba (samedi 6 avril 2006)

Introduction aux services de domaine Active Directory

Bases de données et environnements distribués Chapitre I : Architecture logicielle technologies de developpement en environnement

Architecture PKI en Java

4. SERVICES WEB REST 46

Mise en place d annuaires LDAP et utilisation dans plusieurs applications

WEB page builder and server for SCADA applications usable from a WEB navigator

Le réseau Internet.

Installation Windows 2000 Server

VTP. LAN Switching and Wireless Chapitre 4

Groupe Eyrolles, 2004 ISBN :

NFS Maestro 8.0. Nouvelles fonctionnalités

MapReduce. Malo Jaffré, Pablo Rauzy. 16 avril 2010 ENS. Malo Jaffré, Pablo Rauzy (ENS) MapReduce 16 avril / 15

BAP E Gestionnaire de parc informatique et télécommunications MI2 / MI3 Ouverts au titre de 2010 Arrêté du 7/04/10 - J.

Mise en œuvre des serveurs d application

Le projet d'annuaire LDAP à Rennes 1. - Raymond Bourges - Gérard Delpeuch

Exercices sur SQL server 2000

Windows (2000/NT), Solaris, AIX, HP-UX, Linux Haute disponibilité : SunCluster 3, Veritas Cluster Server 4. J2EE (JSP, Servlet, EJB, JTA), Open Source

PUPPET. Romain Bélorgey IR3 Ingénieurs 2000

EJB. Karim Bouzoubaa Issam Kabbaj

M2-ESECURE Rezo TP3: LDAP - Mail

Les services usuels de l Internet

COMMUNICATION TECHNIQUE N TCV060 Ed. 01. OmniVista 4760 Nb de pages : 18 Date : URGENTE NON URGENTE TEMPORAIRE DEFINITIVE

Exemple d application: l annuaire DNS Claude Chaudet

Extension SSO Java. Cette note technique décrit la configuration et la mise en œuvre du filtre de custom SSO Java.

Déploiement d'un serveur ENT

Logiciel Enterprise Guide Version 1.3 Windows

LINUX Préparation à la certification LPIC-3 (examen LPI 300) - 2ième édition

Gestion des autorisations / habilitations dans le SI:

INTRODUCTION AUX SGBD/R LUW

LDAP & Unified User Management Suite

Journée Josy/PLUME. Outils logiciels libres utiles à tout ASR SAMBA. Maurice Libes. Centre d'océanologie de Marseille UMS 2196 CNRS

WiFi Security Camera Quick Start Guide. Guide de départ rapide Caméra de surveillance Wi-Fi (P5)

Zoom sur Newtest LDAP intégration

Exposé Nouvelles Technologies et Réseaux LDAP 22/01/ Exposé Nouvelle Technologies Réseaux - LDAP. Lightweight Directory Access Protocol

EJBCA PKI. Yannick Quenec'hdu Reponsable BU sécurité

Infrastructure à Clé Publique (PKI Public Key Infrastructure)

EJBCA Le futur de la PKI

Jean-Philippe VIOLET Solutions Architect

XML, PMML, SOAP. Rapport. EPITA SCIA Promo janvier Julien Lemoine Alexandre Thibault Nicolas Wiest-Million

Transcription:

Annuaires (Directory) Didier DONSEZ Université Joseph Fourier IMA IMAG/LSR/ADELE Didier.Donsez@imag.fr http://www-adele.imag.fr/~donsez JNDI

2 Sommaire Concept de Nommage Concept d Annuaire LDAP API ASDI JNDI Principes Architecture API Exemples

3 Concept de Nommage (i) Nommage (Naming) Association d un nom à un objet objet : fichier, usager, machine, service distant Liaison (binding) terme pour désigner une association Exemples: DNS www.sun.com vers 192.9.48.5 FileSystem DOS c:\bin\autoexec.bat vers un fichier CORBA, RMI,...

4 Concept de Nommage (ii) Convention du nommage règles de représentation des noms DNS : identifiants séparés par des. (dot) FS Unix : identifiants séparés par des / FS Dos : nom d unité :\ puis identifiants séparés par des \ LDAP : cn=rosanna Lee, o=sun, c=us Contexte sous-ensemble de liaison sun.com; /usr; o=sun, c=us sont des contextes Naming System ensemble de contextes connectés utilisant la même convention de nommage NameSpace ensemble de noms utilisés par un Naming Service

5 Concept d Annuaire (i) Annuaire (Directory) extension du nommage les objets ont aussi des attributs une imprimante peut avoir des attributs vitesse, resolution, couleur une personne peut avoir un attribut bureau, email organisation généralement hiérarchique Exemple Novell NDS, Solaris NIS, ISO X500, LDAP,...

6 Concept d Annuaire (ii) Recherche (query) dans l Annuaire expression logique sur le nom sur une partie du nom sur la valeur des attributs search filter (appelé aussi reverse lookup ou content-based searching)

Exemple d Annuaire : LDAP Lightweight Directory Access Protocol 7 Proposé par l IETF en 1995 LDAP v3 (RFC 2251) http://www.ietf.org/rfc/rfc2251.txt Simplification de ISO X500 même convention de nommage mais basé sur TCP/IP (plutôt que les couches ISO) Première implantation de l Univ. Michigan Produits commerciaux : IBM, Microsoft, Netscape, Oracle, Sun, Voir http://www.innosoft.com

8 Modèle de données LDAP Directory Information Tree (DIT) arbre d entrées (entries) chaque entrée est composé d un ou de plusieurs attributs typés et multivalués String, données binaires comme JPEG... Espace de nommage hiérarchique Chaque entrée du DIT est nommée Relative Distinguished Name (RDN) Distinguished Name (DN)

9 Modèle de données LDAP Root C=US O=MicroTech OU=Research RDN = { O = MicroTech } DN = { C = US, O = MicroTech } Alias entry Object entry Attr, Attr,... C=GB CN=Fax Machine CN=Sarah Miles OU=Sales L=Winslow CN=Bill Smith CN=John Jones O= Graphic Services CN=Laser Printer CN= Zoe Lange

10 Architecture LDAP Application LDAP gateway (CGI, PHP, Servlet, RMI ) Application API LDAP Client client Appli Java JNDI LDAP SPI LDAP protocol LDAP protocol TCP/IP Model Manager LDAP Server Database Manager Replicated Servers for Fault tolerance Avaibility Performance,...

DSML Directory Services Markup Language 11 Représentation XML (DTD) des données d annuaire http://www.dsml.org

DSML Directory Services Markup Language 12 dn: uid=scarter, ou=people, o=mcom.com cn: Sam Carter sn: Carter givenname: Sam objectclass: top ou: Accounting l: Sunnyvale uid: scarter mail: scarter@mcom.com telephonenumber: +1 408 555 4798 <dsml:dsml xmlns:dsml="http://www.dsml.org/dsml"> <dsml:directory-entries> <dsml:entry dn="uid=scarter, ou=people, o=mcom.com"> <dsml:attr name="cn"><dsml:value>sam Carter</dsml:value></dsml:attr> <dsml:attr name="sn"><dsml:value>carter</dsml:value></dsml:attr> <dsml:attr name="givenname"><dsml:value>sam</dsml:value></dsml:attr> <dsml:objectclass>top</dsml:objectclass> <dsml:objectclass>person</dsml:objectclass> <dsml:objectclass>organizationalperson</dsml:objectclass> <dsml:objectclass>inetorgperson</dsml:objectclass> <dsml:attr name="ou"> <dsml:value>accounting</dsml:value> <dsml:value>people</dsml:value> </dsml:attr> <dsml:attr name="l"><dsml:value>sunnyvale</dsml:value></dsml:attr> <dsml:attr name="uid"><dsml:value>scarter</dsml:value></dsml:attr> <dsml:attr name="mail"><dsml:value>scarter@mcom.com</dsml:value> </dsml:attr> <dsml:attr name="telephonenumber"> <dsml:value>+1 408 555 4798</dsml:value> </dsml:attr> </dsml:entry> </dsml:directory-entries> </dsml:dsml>

ADSI Active Directory Server Interface 13 API Plateforme Windows Multi-langage (C, C++, VB, C#, ASP ) via COM Indépendante du type d annuaire 2 connecteurs livrés en standard ADS (Active Directory), Win2000 LDAPv3 Bases de Registre Windows NT

JNDI Java Naming and Directory Interface 14 API Java Indépendante du type d annuaire 3 SPI (Service Provider) livrés en standard Lightweight Directory Access Protocol (LDAP) CORBA services (COS) naming service Java Remote Method Invocation (RMI) Registry

JNDI Java Naming and Directory Interface Didier DONSEZ Université Joseph Fourier IMA IMAG/LSR/ADELE Didier.Donsez@imag.fr http://www-adele.imag.fr/~donsez

16 Sommaire Principes Architecture API Exemples

17 JNDI - Principe Fournir un API (java) uniforme à des services de nommage ou d annuaire utilisation de pilotes SPI dynamiquement chargeables LDAP, DNS, NIS, NDS, RMI, CORBA, et FileSystems Architecture Java App. Applet Servlet EJB JNDI API Naming Manager JNDI SPI LDAP Corba RMI NDS NIS FS DSML DNS

18 JNDI - APIs Installation inclus dans J2 v1.3 Java Standard Extension dans J1.1 et J2 v1.2 Packages javax.naming, javax.naming.directory, javax.naming.event, javax.naming.ldap, javax.naming.spi SPI : Service Providers ens de classes implémentant javax.naming.spi SPI préinstallés dans J2 v1.3 Lightweight Directory Access Protocol (LDAP) CORBA services (COS) naming service Java Remote Method Invocation (RMI) Registry

19 JNDI ContextFactory (i) FileSystem com.sun.jndi.fscontext.fscontextfactory com.sun.jndi.fscontext.reffscontextfactory Lightweight Directory Access Protocol (LDAP) com.sun.jndi.ldap.ldapctxfactory CORBA services (COS) naming service Java Remote Method Invocation (RMI) Registry NIS com.sun.jndi.rmi.registry.registrycontextfactory com.sun.jndi.nis.nisctxfactory NDS com.novell.naming.service.nds.ndsinitialcontextfactory

20 JNDI ContextFactory (ii) DNS DSML

JNDI 21 Création du contexte LDAP String login="directory Manager"; String password="motdepasse"; Hashtable env = new Hashtable(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.security_authentication, "simple"); env.put(context.security_principal, "cn="+login); env.put(context.security_credentials, password); env.put(context.provider_url, "ldap://localhost:389/o=jnditutorial"); Context ctx = new InitialContext(env);

JNDI 22 ExempIe 1 avec LDAP Attributes answer = ctx.getattributes("cn=ted Geisel, ou=people"); for (NamingEnumeration ae = answer.getall(); ae.hasmore();) { Attribute attr = (Attribute)ae.next(); System.out.println("attribute: " + attr.getid()); /* print each value */ for (NamingEnumeration e = attr.getall(); e.hasmore(); System.out.println("value: " + e.next())); }

JNDI 23 ExempIe 1 avec LDAP # java GetattrsAll attribute: sn value: Geisel attribute: objectclass value: top value: person value: organizationalperson value: inetorgperson attribute: jpegphoto value: [B@1dacd78b attribute: mail value: Ted.Geisel@JNDITutorial.com attribute: facsimiletelephonenumber value: +1 408 555 2329 attribute: telephonenumber value: +1 408 555 5252 attribute: cn value: Ted Geisel

JNDI 24 ExempIe 2 avec LDAP // Set up environment for creating initial context Hashtable env = new Hashtable(); env.put(context.initial_context_factory, "com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://localhost:389/o=jnditutorial"); Context ctx = new InitialContext(env); // Specify the ids of the attributes to return String[] attrids = {"sn", "telephonenumber", "golfhandicap", "mail"}; // Get the attributes requested Attributes answer = ctx.getattributes("cn=ted Geisel, ou=people", attrids); for (NamingEnumeration ae = answer.getall(); ae.hasmore();) { Attribute attr = (Attribute)ae.next(); System.out.println("attribute: " + attr.getid()); /* print each value */ for (NamingEnumeration e = attr.getall(); e.hasmore(); System.out.println("value: " + e.next())); }

JNDI 25 ExempIe 2 avec LDAP # java Getattrs attribute: sn value: Geisel attribute: mail value: Ted.Geisel@JNDITutorial.com attribute: telephonenumber value: +1 408 555 5252

JNDI 26 ExempIe 3 avec LDAP // Specify the changes to make ModificationItem[] mods = new ModificationItem[3]; // Replace mail attribute with new value mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("mail", "geisel@wizards.com")); // Add additional value to "telephonenumber" mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("telephonenumber", "+1 555 555 5555")); // Remove jpegphoto mods[2] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("jpegphoto")); // Perform requested modifications on named object ctx.modifyattributes(name, mods);

JNDI ExempIe 4 avec LDAP Basic Search 27 // Specify the attributes to match // Ask for objects with a surname ("sn") attribute with value "Geisel" // and which have the "mail" attribute. Attributes matchattrs = new BasicAttributes(true); // ignore attribute name case matchattrs.put(new BasicAttribute("sn", "Geisel")); matchattrs.put(new BasicAttribute("mail")); // Search for objects with those matching attributes NamingEnumeration answer = ctx.search("ou=people", matchattrs); while (enum.hasmore()) { SearchResult sr = (SearchResult)enum.next(); System.out.println(">>>" + sr.getname()); printattrs(sr.getattributes()); }

JNDI ExempIe 5 avec LDAP Search Filter 28 // Create default search controls SearchControls ctls = new SearchControls(); // Specify the search filter to match // Ask for objects with attribute sn == Geisel and which have the "mail" attribute. String filter = "(&(sn=geisel)(mail=*))"; // Search for objects using filter NamingEnumeration answer = ctx.search("ou=people", filter, ctls);

JNDI ExempIe 5 avec LDAP Search Filter 29 // Specify the ids of the attributes to return String[] attrids = {"sn", "telephonenumber", "golfhandicap", "mail"}; // Specify the search control SearchControls ctls = new SearchControls(); ctls.settimelimit(1000); // limit to 1000 ms ctls.setreturningattributes(attrids); ctls.setsearchscope(searchcontrols.subtree_scope); // Specify the search filter to match // Ask for objects with attribute sn == Geisel and which have the "mail" attribute. String filter = "(&(sn=geisel)(mail=*))"; // Search subtree for objects using filter NamingEnumeration answer = ctx.search("", filter, ctls);

30 Symboles de Filtrage Symbol Description & conjunction (i.e., and -- all in list must be true) disjunction (i.e., or -- one or more alternatives must be true)! negation (i.e., not -- the item being negated must not be true) = equality (according to the matching rule of the attribute) ~= approximate equality (according to the matching rule of the attribute) >= greater than (according to the matching rule of the attribute) <= less than (according to the matching rule of the attribute) =* presence (i.e., entry must have the attribute but its value is irrelevant) * wildcard (indicates zero or more characters can occur in that position) This is to be used when specifying attribute values to match. \ escape (for escaping '*', '(', or ')' when they occur inside an attribute value)

31 DSML et JNDI Provider (SPI) JNDI / DSML Accéder à des documents DSML Manipuler et modifier leur contenu Ré-exporter le contenu en DSML

32 Exemple JNDI Navigateur-Editeur LDAP de Jarek Gawor http://www.iit.edu/~gawojar/ldap Pur Java et JNDI Tutorial JNDI http://java.sun.com/products/jndi/tutorial/toc.html Passerelle DSML http://www.worldspot.com/dsmlgw-xml-rpc/dsmlgateway.html

33 Bibliographie Spécifications et Tutorial JNDI http://java.sun.com/products/jndi http://java.sun.com/products/jndi/tutorial/toc.html Rosanna Lee, Scott Seligman, "JNDI API Tutorial and Reference: Building Directory-Enabled Java Applications (The Java Series)", (May 30, 2000), Ed Addison-Wesley Pub Co; ISBN: 0201705028

34 Bibliographie David Flanagan, Jim Farley, William Crawford & Kris Magnusson, «Java Enterprise in a Nutshell, A Desktop Quick Reference», Edition Oreilly, 1st Edition September 1999, ISBN 1-56592-483-5 Chapter 6 John Rhoton, «Programmer's Guide to Internet Mail : Smtp, Pop, Imap, and Ldap», October 1999, Digital Press; ISBN: 1555582125 Mark Wilcox, «Implementing LDAP», March 1999, Wrox Press Inc; ISBN: 1861002211 Andrew Patzer, "Programmation Java côté serveur : Servlets, JSP et EJB", Ed Eyrolles-Wrox, 2000, ISBN 1-861002-77-7 (sources des exemples sur www.wroxfrance.com) chapitres 21 et 22 Marcel Rizcallah, Construire un annuaire d entreprise avec LDAP, Ed Eyrolles, 2000, ISBN, 2-212-09154-0 Des études de cas D autres livres sur http://www.ldapzone.com/books.html

35 Bibliographie Melissa Craft, «Active Directory pour Windows 2000 Server», Edition Eyrolles, 2000, ISBN 2-212-09167-2 Active Directory http://www.microsoft.com/windows2000/library/technologies/active directory ADSI http://www.microsoft.com/windows2000/library/howitworks/adsilink s.asp#heading2

36 Acteurs et Produits Acteurs et Produits Netscape, Microsoft, IBM, http://www.ldapzone.com/products.html OpenSource Serveur LDAP de l Université du Michigan http://www.umich.edu/~dirsvcs/ldap/ldap.html Serveur LDAP en OpenSource (http://www.openldap.org) écrit en C Autres Sites LDAP Browser/Editor http://www.iit.edu/~gawojar/ldap/index.html An LDAP Roadmap FAQ http://www.kingsmountain.com/ldaproadmap.shtml Introduction to slapd and slurpd http://www.umich.edu/~dirsvcs/ldap/doc/guides/slapd/1.html#rtftoc1 Intranet Design: RFC-1777 (LDAP) http://idm.internet.com/rfc/rfc-1777.html Tips for LDAP Users http://java.sun.com/products/jndi/tutorial/ldap/index.html Searching the Directory http://curiac.acomp.usf.edu/db/ldap/sdk/search.htm#2839729