Naming and Directory Services Days 1 and 2 Introduced You to Enterprise Computing Concepts and J2EE Tech- Nologies Such As Ejbs and Servlets

Total Page:16

File Type:pdf, Size:1020Kb

Naming and Directory Services Days 1 and 2 Introduced You to Enterprise Computing Concepts and J2EE Tech- Nologies Such As Ejbs and Servlets 05 0672325586 CH03 4/5/04 1:39 PM Page 71 WEEK 1 DAY 3 Naming and Directory Services Days 1 and 2 introduced you to enterprise computing concepts and J2EE tech- nologies such as EJBs and Servlets. This chapter will show how the Java Naming and Directory Interface (JNDI) supports the use of many of the J2EE components. In its simplest form, JNDI is used to find the resources (such as EJBs) that you have registered via the J2EE server. Advanced use of JNDI supports sophisti- cated storage and retrieval of Java objects and other information. This day’s work will include • Using Naming and Directory Services • JNDI and X.500 names • Obtaining a JNDI Initial Context • Binding and looking up names • Name attributes • Objects and References • JNDI events and security 05 0672325586 CH03 4/5/04 1:39 PM Page 72 72 Day 3 Naming and Directory Services A Naming Service provides a mechanism for giving names to objects so you can retrieve and use those objects without knowing the location of the object. Objects can be located on any machine accessible from your network, not necessarily the local workstation. A real-world example is a phone directory. It stores telephone numbers against names and addresses. To find people’s phone numbers is simply a matter of using their name (and possibly address) to identify an entry in the phone book and obtaining the stored phone number. There are a few complications, such as finding the right phone book to look in, but it is essentially a simple process. Incidentally, naming services have a similar problem to that of finding the right phone book. This is known as obtaining a context. A name can only be found if you examine the right context (phone book). A Directory Service also associates names with objects but provides additional informa- tion by associating attributes with the objects. The yellow pages phone directory is a simple form of a directory service. Here, busi- nesses often include advertisements with additional information such as a list of products sold, professional qualifications, affiliated organizations, and even maps to their premises. These attributes add value to the name entry. A directory service will normally provide the ability to find entries that have particular attributes or values for attributes. This is similar to searching the yellow pages for all plumbers running a 24-hour emer- gency service within a certain area. Yellow page style phone books also store names under categories—for example, hair- dressers or lawyers. Categorizing entries can simplify searching for a particular type of entry. These categorized entries are a form of sub-context within the directory context of the local phone book. Why Use a Naming or Directory Service? Naming Services provide an indispensable mechanism for de-coupling the provider of a service from the consumer of the service. Naming services allow a supplier of a service to register their service against a name. Users, or clients, of the service need only know the name of the service to use it. Think of the phone book once more, and how difficult it would be to find someone’s phone number without it. Obtaining your friend’s phone number would mean going to their home and asking, or waiting until you meet up with them again—which may be dif- ficult to organize because you can’t phone them to arrange the meeting. At the end of the day, it is very difficult to imagine a world without naming services. 05 0672325586 CH03 4/5/04 1:39 PM Page 73 Naming and Directory Services 73 What Is JNDI? JNDI is a Java API that defines an interface to Naming and Directory Services for Java programs. JNDI is just an API and not, in itself, a Naming and Directory Service. To use JNDI, an implementation of a Naming and Directory service must be available. JNDI provides a service-independent interface to the underlying Service Provider implementa- tion. Figure 3.1 shows how the JNDI layer interfaces between the Java program and the under- lying naming services. Additional naming services can be plugged into the JNDI layer by implementing the Service Provider Interface (SPI) for JNDI. FIGURE 3.1 Java Program JNDI Architecture. 3 JNDI Application programming Interface (API) Naming Manager JNDI Service Provider Interface (SPI) LDAP DNS NDS CORBA RMI NIS ??? JNDI has been a standard component of J2SE since version 1.3. JNDI is available as a standard Java extension for JDK 1.2 and earlier. JNDI has always been a required com- ponent of J2EE. Common Naming Services Figure 3.1 shows that JNDI supports plug-in Service Providers for several well-known naming services, including the following: • Lightweight Directory Access Protocol (LDAP) is the approved standard for an Internet naming service. LDAP is a true directory service and supports attributes as well as names for objects. LDAP is fast becoming the de facto directory service for the enterprise. • Domain Name System (DNS) is the Internet naming service for identifying machines on a network. 05 0672325586 CH03 4/5/04 1:39 PM Page 74 74 Day 3 • Novell Directory Services (NDS) from Novell provides information about network services, such as files and printers. NDS is found primarily in environments where the main networking software is Novell. • Network Information Service (NIS) from Sun Microsystems provides system-wide information about machines, files, users, printers, and networks. NIS is primarily found on Solaris systems, but Linux and some other Unix platforms also support it. JNDI also supports some more specialized naming systems. For example, CORBA for distributed component programming and RMI for distributed Java programming. Although there is no named Service Provider for Windows Active Directory within JNDI, it is supported. Windows Active Directory supports an LDAP interface, and you can access it via the JNDI LDAP Service Provider Interface. Naming Conventions Each naming service has its own mechanism for supplying a name. Perhaps the most familiar naming convention is DNS, where every machine connected to the Internet has a unique name and address. Most readers will recognize the following as a host name used by DNS: www.samspublishing.com In contrast, LDAP names are based on the X.500 standard and use distinguished names that look like the following fictitious example: cn=Martin Bond, ou=Authors, o=SAMS, c=us This format will also be familiar to users of Microsoft’s Active Directory service, whose naming system is also based on X.500 but uses a forward slash to separate the various name components: cn=Martin Bond/ou=Authors/o=SAMS/c=us These last two naming conventions have similarities in that they are both hierarchically structured with the more specific names (such as cn=Martin Bond) being qualified by a general name (such as o=SAMS). JNDI applies minimal interpretation to names specified as String objects. JNDI uses the forward slash character (/) as a name separator to provide a simple name hierarchy called a Composite Name. It is conventional for these composite names to be used to group related names (such as plumbers in the phone book). As an example, JDBC data sources take names of jdbc/XXX and EJBs the form ejb/XXX. While this is only a con- vention, it does help separate different sorts of named objects within the JNDI name 05 0672325586 CH03 4/5/04 1:39 PM Page 75 Naming and Directory Services 75 space. Composite names can span different naming systems. An LDAP name can combine with a file system name to get a composite name: cn=Martin Bond, ou=Authors, o=SAMS, c=us/agency/agency.ldif Here a filename (agency/agency.ldif) is appended to an LDAP name. How JNDI inter- prets this is up to the individual Service Provider. Incidentally, JNDI calls structured names like the DNS and LDAP names Compound Names. JNDI does not interpret compound names, but simply passes them through to the Service Provider. In addition to forward slash (/), JNDI also treats backslash (\), single quote (‘), and dou- ble quote (“) characters as special. If a compound name or a component of a name con- 3 tains any of these characters, they must be escaped using the backslash character (\). Remember that backslash and double quotes are also special characters in Java string lit- erals and must be escaped. Therefore to insert a double quote into a JNDI name you must place \\\” into the string literal. For example the following is how to insert the name jdbc/”Agency”—avoid this if you can. “jdbc/\\\”Agency\\\”” If the underlying Service Provider uses the forward slash as a name separator (as does the CORBA name service for example), there appears to be a conflict between JNDI and the Service Provider. In practice, this is unlikely to be a problem because JNDI recog- nizes two sorts of name separation—weak and strong. JNDI always passes the entire name to the Service Provider. A strong name separation implementation (such as LDAP or DNS) simply processes the first part of the composite name and returns the remainder to the JNDI Naming Manager to pass on to other name services. A weak name separation implementation will process the entire composite name. This is not something you need to worry about unless you are writing a Service Provider. For those programmers who need to do more than use names to look up and bind objects, JNDI provides several classes for manipulating and parsing composite and com- pound names. The JNDI name support classes in the javax.naming package are Name, CompositeName, and CompoundName. Using JNDI with J2EE RI As far as this book is concerned the role of JNDI is to support access to the different components of your application.
Recommended publications
  • Open Directory & Openldap
    Open Directory & OpenLDAP David M. O’Rourke Engineering Manager Overview • Background on Apple’s Open Directory Technology (8 minutes) – What is it – What is Directory Services • How has Apple integrated OpenLDAP (20 minutes or less) – what has Apple added to OpenLDAP? • Questions and Answers (remaining time) Open Directory • Open Directory is a technology name – Covers both client access technologies and server technologies – Integrates and promotes industry standard technologies • Open Directory is built into Mac OS X & Mac OS X Server – Been there since 10.0 • Open Sourced as part of Darwin – http://developer.apple.com/darwin/projects/ opendirectory/ What Is Directory Services • Abstraction API for read/write access to system configuration and management data – Users, groups, mount records and others – Authentication abstraction Mac OS X Software Directory Services NetInfo LDAP BSD Files Other… Directory Services in 10.3 • Includes – LDAPv3 (read/write), Native Active Directory, NetInfo, NIS, BSD/etc files – Service Discovery: Rendezvous, SMB, AppleTalk, and SLP – LDAPv3 client support replication fail over • Documented Access API and plug-in API – SDK posted – Sample code, sample plug-in, notes – Directory Services Headers are installed in – /System/Library/Frameworks/DirectoryService.framework – Command line tool for directory editing ‘dscl’ 10.3 Usage of Directory Services • Login Window uses Directory Services for all user authentication – Managed Desktop • All Security Framework authentication uses Directory Services • Legacy Unix
    [Show full text]
  • AWS Directory Service Setup with Netapp Cloud Volumes Service for AWS Prabu Arjunan, Netapp August 2019
    AWS Directory service setup with NetApp Cloud Volumes Service for AWS Prabu Arjunan, NetApp August 2019 Abstract This document provides instructions to help users set up the AWS directory services environment for using NetApp® Cloud Volumes Service for Amazon Web Services (AWS). TABLE OF CONTENTS 1 Overview ................................................................................................................................................ 3 2 Requirements ........................................................................................................................................ 3 3 Creating the AWS Active Directory service ....................................................................................... 4 4 Adding the Active Directory server to Cloud Volumes Service ..................................................... 10 5 Creating a cloud volume that uses the Active Directory server .................................................... 12 Common errors messages....................................................................................................................... 14 References ................................................................................................................................................. 14 Version History ......................................................................................................................................... 14 2 AWS Directory service setup with NetApp Cloud Volume Service for AWS © 2019 NetApp, Inc. All rights reserved. 1 Overview
    [Show full text]
  • White Paper | September 2 0 1 7
    Oracle Directory Services Buyer’s Guide ORACLE WHITE PAPER | SEPTEMBER 2 0 1 7 Disclaimer The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. ORACLE DIRECTORY SERVICES – BUYER’S GUIDE Table of Contents Introduction 1 Business Drivers 2 Oracle Directory Services 3 Key Considerations for Some Popular Scenarios 4 Cloud 4 Mobile 4 Customer-Facing Internet 4 Employee-Facing Intranet 5 Directory Services Checklist 5 Conclusion 7 ORACLE DIRECTORY SERVICES – BUYER’S GUIDE Introduction In the late 1990s, directory servers were essentially designed as white-page applications for providing users with secure access to enterprise resources through authentication and authorization processes. Since then, their use has been extended to partners and customers, thus creating the need to support an increasing number of diverse users and communities. Today, directory services need to accommodate hundreds of millions of users and provide additional services to break identity silos. With the ubiquitous use of mobile devices as well as cloud deployments and the integration of social networks identities into the enterprise fabric, billions of objects are transacted everyday through directory services. Modern directory services now go beyond the initial capability to store objects in an identity repository. Directory solutions have evolved around three foundation services: » Storage: Persisting and maintaining entries representing identities.
    [Show full text]
  • The 12 Essential Tasks of Active Directory Domain Services
    WHITE PAPER ACTIVE DIRECTORY DOMAIN SERVICES The 12 Essential Tasks of Active Directory Domain Services Using the right tools and processes helps reduce administrative overhead and ensures directory service is always available By Nelson Ruest and Danielle Ruest Sponsored by WHITE PAPER ACTIVE DIRECTORY DOMAIN SERVICES ABSTRACT Active Directory Domain Services (AD DS) administration and management includes Sponsored by 12 major tasks. These tasks cover a wide breadth of business needs and are not all performed solely by AD DS administrators. In fact, administrators can and should delegate several tasks to other members of their technical community, technicians, help desk personnel, even users such as team managers and administrative assistants. While delegation is a way to reduce the amount of work administrators have to do when managing AD DS infrastructures, it really only addresses one or two of the 12 tasks, for example, user and group administration as well as end point device administration. The other ten tasks can be staggering in nature—security, networked service administration, OU-Specific Management, Group Policy Object management and many more—and because of this can take up inordinate amounts of time. You can rely on Microsoft’s built-in tools to reduce some of this workload, but are the native tools enough? Perhaps it’s time to reduce AD DS administration overhead by automating most tasks and tightening internal security. Address this by first, determining what the twelve essential labors of Active Directory are and then, see how you can reduce AD DS workloads through the implementation of proper management and administration tools.
    [Show full text]
  • [MS-DSSP]: Directory Services Setup Remote Protocol
    [MS-DSSP]: Directory Services Setup Remote Protocol Intellectual Property Rights Notice for Open Specifications Documentation . Technical Documentation. Microsoft publishes Open Specifications documentation (“this documentation”) for protocols, file formats, data portability, computer languages, and standards support. Additionally, overview documents cover inter-protocol relationships and interactions. Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you can make copies of it in order to develop implementations of the technologies that are described in this documentation and can distribute portions of it in your implementations that use these technologies or in your documentation as necessary to properly document the implementation. You can also distribute in your implementation, with or without modification, any schemas, IDLs, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications documentation. No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation. Patents. Microsoft has patents that might cover your implementations of the technologies described in the Open Specifications documentation. Neither this notice nor Microsoft's delivery of this documentation grants any licenses under those patents or any other Microsoft patents. However, a given Open Specifications document might be covered by the Microsoft Open Specifications Promise or the Microsoft Community Promise. If you would prefer a written license, or if the technologies described in this documentation are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting [email protected].
    [Show full text]
  • Pingdirectory Administration Guide Version
    Release 7.3.0.3 Server Administration Guide PingDirectory | Contents | ii Contents PingDirectory™ Product Documentation................................................ 20 Overview of the Server............................................................................. 20 Server Features.................................................................................................................................20 Administration Framework.................................................................................................................21 Server Tools Location....................................................................................................................... 22 Preparing Your Environment....................................................................22 Before You Begin.............................................................................................................................. 22 System requirements..............................................................................................................22 Installing Java......................................................................................................................... 23 Preparing the Operating System (Linux).......................................................................................... 24 Configuring the File Descriptor Limits.................................................................................... 24 File System Tuning.................................................................................................................25
    [Show full text]
  • Oracle Internet Directory 11G R1
    2 3 Directory services are key building blocks for secure identity-enabled business applications and the underlying enterprise identity management (IdM) architecture. Well-structured and organized directory services are the foundation of efficient and effective security services. This is because all IDM applications and most commercial off the shelf (COTS) business applications that require a standard mechanism to access identity attributes, and the most common way to access identity attributes is using LDAP. Example identity attributes include user credentials, access privileges and profile information. Additionally the modern enterprise has different identity attribute needs than they did when LDAP servers first appeared on the market in the 1990s. This is because modern enterprises often have multiple LDAP storage-based servers as well as identity stored in non-LDAP repositories such as HR or CRM databases. Furthermore, new computing initiatives, such as mobile computing, cloud computing and social networking, require LDAP to manage extremely large number of objects, to deliver high performance to manage dynamic data like location and presence, and to be elastic to grow with the cloud. These requirements led to several challenges in deploying identity related applications within the enterprise: While Microsoft Active Directory is pervasive within enterprises, it does not provide the functionality to be a general purpose Enterprise Directory Service because of limitations imposed on it being the Network Operating System directory for Windows. To address Active Directory limitations, Microsoft provides Active Directory Lightweight Directory Services (AD LDS)1. However, due to AD LDS‟s application specific nature, the 1 AD LDS formerly known as Active Directory Application Mode (ADAM) 4 proliferation of AD LDS within enterprises is like weeds in a garden resulting in cost and manageability issues.
    [Show full text]
  • Open Directory Administration for Version 10.5 Leopard Second Edition
    Mac OS X Server Open Directory Administration For Version 10.5 Leopard Second Edition Apple Inc. © 2008 Apple Inc. All rights reserved. The owner or authorized user of a valid copy of Mac OS X Server software may reproduce this publication for the purpose of learning to use such software. No part of this publication may be reproduced or transmitted for commercial purposes, such as selling copies of this publication or for providing paid-for support services. Every effort has been made to make sure that the information in this manual is correct. Apple Inc., is not responsible for printing or clerical errors. Apple 1 Infinite Loop Cupertino CA 95014-2084 www.apple.com The Apple logo is a trademark of Apple Inc., registered in the U.S. and other countries. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws. Apple, the Apple logo, iCal, iChat, Leopard, Mac, Macintosh, QuickTime, Xgrid, and Xserve are trademarks of Apple Inc., registered in the U.S. and other countries. Finder is a trademark of Apple Inc. Adobe and PostScript are trademarks of Adobe Systems Incorporated. UNIX is a registered trademark of The Open Group. Other company and product names mentioned herein are trademarks of their respective companies. Mention of third-party products is for informational purposes only and constitutes neither an endorsement nor a recommendation. Apple assumes no responsibility with regard to the performance or use of these products.
    [Show full text]
  • Red Hat Enterprise Ipa
    RED HAT ENTERPRISE IPA INTRODUCTION Red Hat Enterprise IPA enables your organization to comply with regulations, reduce risk, and become more efficient. Simply and centrally manage your Linux/Unix users and their authentication today. And in the future, your Linux/Unix machines, services, policy, and audit information. Government and industry compliance regulations, as well as best practice risk reduction principles require an organization to establish: • the administrative users accessing machines and services on those machines • which machines and services users have accessed • the actions those users took • policies to control user access to particular machines and service • policies around password strength to protect against unauthorized access Establishing these things simply and centrally, in addition to the obvious security benefits, brings significant efficiencies such as: • reduced time and manual work in an internal or external audit • reduced time spent adjusting parameters and policies for individual machines • more rapid deployment and migration of workloads in the environment • increased ability to benefit from initiatives such as Red Hat Linux Automation www.dlt.com/redhat Red Hat Enterprise IPA | Karl Wirth EXISTING SOLUTIONS To solve these problems, organizations have essentially three options. Roll your own solution; purchase an expensive proprietary solution; or leverage an existing Microsoft Active Directory infrastructure for your Unix/Linux identity and policy. ROLL YOUR OWN For over a decade, organizations have used Sun’s Network Information Services (NIS) and NIS+ to provide central management of identity and policy for users and machines in the Linux and Unix environment. NIS has some serious weaknesses that could cause NIS to fail some security compliance audits.
    [Show full text]
  • Openls Directory Service Architectures and Implementation Based on Web-Service
    OpenLS Directory Service Architectures and Implementation based on Web-Service Jae-Chul Kim, Sung-Soo Kim, Tae-Wook Heo, Jong-Hyun Park LBS Team, Spatial Information Technology Center, ETRI 161 Kajong-Dong, Yusong-Gu, Daejon, Korea [email protected] Abstract: In this paper, we developed those Directory Services used to describe any kind of content in a structured way, based on the Web-Service, because Web-Service environments separated from its presentation to a specific device [2]. provide a suitable method to gather requested information in an SOAP (Simple Object Access Protocol) is a network, appropriate way. The proposed architecture cooperate with transport, and programming language-neutral protocol other OpenLS(Open Location Service) Core Services ( Location that allows a client to call a remote service. The message Utility Service and Router Determin ation service) and is an format is XML [3]. interoperability one — it identifies those global elements of the global Web-Services network that are required in order to en- WSDL (Web-services description language) is an sure interoperability between Web-Services. In this paper, a XML-based interface and implementation description new architecture of Directory Service with OpenLS Core Ser- language. The service provider uses a WSDL document vices is proposed and tested in OpenLS Core Services envi- in order to specify the operations a Web-Service pro- ronments. vides, as well as the parameters and data types of these Keywords: Web-Service, Directory service, OpenLS. operations. A WSDL document also contains the service access information [4]. UDDI (universal description, discovery, and integra- 1. Introduction tion) is both a client-side API and a SOAP-based server implementation that can be used to store and retrieve information on service providers and Web-Services [5].
    [Show full text]
  • Solaris™ Naming and Directory Service
    SOLARIS™NAMING AND DIRECTORY SERVICE THE SOLARIS™ OPERATING ENVIRONMENT LDAP AS A NAMING SERVICE The Solaris™ 8 Operating Environment is the established OS leader Solaris 8 introduces support for LDAP as the access protocol for for availability, scalability, and security in the Internet age. In Solaris naming services. LDAP is a directory standard defined by the Internet 8 software, Sun delivers a trustworthy, universal platform to meet Engineering Task Force (IETF). The Solaris 8 Operating Environment the needs of .com businesses — from small startups to large lets you define information such as usernames, host names, Fortune 1000 enterprises. passwords, and other network resources on any directory server (for example, the iPlanet™ Directory Server) supporting the LDAP v3 It’s no surprise that the Solaris Operating Environment is the leading protocol. The LDAP server stores this information in a hierarchical UNIX® environment today. Solaris software was originally designed namespace called a Directory Information Tree (DIT). The DIT with the Internet in mind. TCP/IP, the central Internet protocol, has consists of entries that are composed of attribute-value pairs. been at the core of Solaris networking for more than 15 years. Each attribute has a type and can have one or more values. Through its time-tested design — a small, stable kernel, modular Naming information, such as host names and passwords, and extensible components, and well-defined interfaces — Solaris will be stored in these entries as attribute values. software delivers rock-solid stability and predictability for business- critical applications. And the Solaris 8 Operating Environment In the Solaris 8 Operating Environment, LDAP clients can use the provides complete compatibility with prior versions, so you can LDAP v3 protocol to access naming information from LDAP servers.
    [Show full text]
  • Freeipa-Manager
    Masaryk University Faculty of Informatics freeipa-manager Bachelor’s Thesis Kristián Leško Brno, Fall 2019 Masaryk University Faculty of Informatics freeipa-manager Bachelor’s Thesis Kristián Leško Brno, Fall 2019 This is where a copy of the official signed thesis assignment and a copy ofthe Statement of an Author is located in the printed version of the document. Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Kristián Leško Advisor: doc. RNDr. Vlastislav Dohnal, Ph.D. i Acknowledgement My gratitude goes to Michal "Blesk" Marciniszyn, the author of the original idea behind freeipa-manager, and to the rest of our team at GoodData for their patient guidance and support. iii Abstract The goal of this work is to facilitate an improvement in identity man- agement and access control processes in a corporate environment. The thesis implements a tooling for verification and application of access control structures in a FreeIPA server, providing a possibility of clean access rule design and better review and audit options. The implemented software serves for synchronization of access control entities between an authoritative configuration source and the server. iv Keywords FreeIPA, identity management, LDAP, RBAC, access control v Contents Introduction 1 1 Identity management (IdM) 3 1.1 Motivation ..........................3 1.2 Concepts ............................4 2 IdM technologies overview 5 2.1 Directory service .......................5 2.2 LDAP .............................6 2.3 Common IdM solutions ....................6 2.4 Existing solutions evaluation .................8 3 FreeIPA 9 3.1 Features ............................9 3.2 Entity representation ....................
    [Show full text]