![]() |
Sun ONE Identity Server Programmer's Guide |
Chapter 5 Identity Management
The Identity Management module of SunTM ONE Identity Server contains an XML template file and application programming interfaces (APIs) that provide functionality to, among other operations, create, delete and manage identity entries in the Sun ONE Directory Server used for data storage. This chapter offers information on the public APIs. It contains the following sections:
Overview
The Identity Management module of Identity Server allows for the management of identity-related objects stored in the Directory Server. Towards this end, it provides interfaces for creating and managing identity-related objects in the Directory Server. The management functions that can be performed include the creation and deletion of specific objects as well as the ability to get, add, modify, or remove the attributes of these objects. The interfaces include a set of templates, defined in the ums.xml file, that contain LDAP configuration information for identity-related objects and a Java Software Development Kit (SDK) to embed the management functions into applications or services.
Abstract Objects
Identity Server represents the objects it manages abstractly; in other words, an organization in Identity Server does not necessarily map to an LDAP organization in the Directory Server. The default abstract objects are:
organization
Note
For more information, see "amEntrySpecific.xml Schema".
Marker Object Classes
Abstract objects are identified in the Directory Server by object classes that are referred to as marker and defined in an Identity Server schema. The marker object classes are then used in LDAP object entries. For example, the Directory Server may use organizational units for their first level structure; by adding the Identity Server organization marker object class, iplanet-am-managed-org, to the LDAP entries of these organizational units, Identity Server can manage them as organizations. It is the use of marker object classes that allows Identity Server to manage most directory structures, regardless of the LDAP object classes and naming attributes deployed. The marker object classes are:
iplanet-am-managed-filtered-group
iplanet-am-managed-assignable-group
iplanet-am-managed-static-group
iplanet-am-managed-people-container
iplanet-am-managed-group-container
Object Templates
The ums.xml provides a set of parameters, known as Templates, that contain LDAP configuration information for all identity-related objects. Identity Server uses these templates to define the configuration of the Directory Server entries that store the Identity Server entry information created by the Identity Server SDK. The file can be found in the <identity_server_root>/SUNWam/config/ums directory and is based on the sms.dtd. The templates provide LDAP structure for:
The templates are used by the Identity Server SDK for the creation of identity-related objects in the Directory Server, as well as the dynamic generation of the object's roles and the construction of object searches. (These templates can be modified by administrators to alter the behavior of the Java interfaces.) Using these templates and the LDIF schema, parameters are configured for all identity-related objects.
When Identity Server is installed, the ums.xml file is stored in the Directory Server as the DAI service. (DAI is a service in the Identity Server whose configuration is not made available through the console.) The Identity Server SDK gets the configuration information from this node when it is being asked to create an identity-related object, generate a role or perform a search. Any attribute specified in the ums.xml can be set for a created object.
Structure of ums.xml
The ums.xml defines three types of templates: Structure, Creation and Search. Structure templates define the Directory Server DIT attributes for the object. Creation templates define an LDAP template for the object being created. Search templates define guidelines for performing searches using LDAP.
Structure Templates
Structure templates define the form an Identity Server object will take in the Directory Server DIT. This conforms to where the object is located within the DIT; the objects are strictly LDAP entries. There are six attributes that need to be defined for each subschema.
classThis attribute represents the name of the Java class that will implement the object. This attribute is fixed and should never be modified.
nameThis attribute defines the entry type of the object. For example, an organization object has o=org as its name.
childNodeThis attribute specifies the child nodes that will be created in tandem with the object.
templateThis attribute specifies the Creation template used to create this object.
filterThis attribute specifies a filter that will be used to identify the object.
Creation Templates
Every identity object that Identity Server creates has a corresponding creation template which defines the LDAP schema for the object. It specifies which object classes and attributes are mandatory or optional and which default values, if any, should be set. This conforms to the actual LDAP entry in the Directory Server. There are six attributes that need to be defined for each subschema.
nameThis attribute defines the name of the object the template will create. It is also the name of the template itself.
javaclassThis attribute defines the name of the Java class used to instantiate the object.
requiredThis attribute defines the required LDAP attributes for the object.
optionalThis attribute defines the optional LDAP attributes for the object.
validatedThis attribute is reserved for future use.
namingattributeThis attribute specifies the LDAP entry type.
Search Templates
Search templates are used to define how searches for Identity Server objects are performed in the Directory Server. This template defines a default search filter and the attributes returned in a search. For example, a search filter is constructed which defines and specifies which attributes and values are to be retrieved from the Directory Server.
nameThis attribute defines the name of the search template.
searchfilterThis attribute defines the LDAP search filter.
attrsThis attribute specifies the LDAP attributes that need to be returned.
Modifying ums.xml
Any new LDAP attributes or object classes must be added to the ums.xml file in order for them to be recognized by the Identity Server. In most cases, the attributes that service developers might want to add may already exist in the inetorgperson and the inetuser object classes. If, for example, a custom mail service is being added with, specifically, an employee_id attribute, the ums.xml file does not need to be modified because this attribute already exists in the inetorgperson object class. Generally, as in the example, the ums.xml file does not need to be modified. The only circumstances where this file would need to be modified are:
if DSAME is being installed against a legacy DIT.
if new object classes are being added to users or organizations.
if service developers want to change the default organizations or roles.
if service developers need to change an entry's naming attribute. Additional information on when and how to modify the ums.xml file is covered in the section on installing against a legacy DIT in the Sun ONE Identity Server Installation and Configuration Guide.
It is highly recommended that the ums.xml configuration file is duplicated before any modifications are made.
Adding Custom Object Classes
If a service developer wanted to add new or customized object classes to the Directory Server for Identity Server's use, they would need to modify the templates in the ums.xml file. Then, to manage them from the Identity Server console, these new object classes and attributes have to be modelled as an XML service file and imported into Identity Server using the procedures described in Chapter 6 "Service Management."
Identity Server SDK
The Identity Server SDK contains APIs for identity management. These interfaces can be used by developers to integrate management functions into external applications or services that will be managed by the Identity Server. The APIs function to create or delete identity-related objects as well as get, modify, add or delete the object's attributes. The com.iplanet.am.sdk package contains all the interfaces and classes necessary to perform these operations in the Directory Server.
SDK Interfaces
Below are brief explanations of the Identity Server SDK interfaces.
AMConstants
AMConstants is the base interface for all identity-related objects. It is used to define the scope of a search of the Directory Server. It can search for a specific object, a particular level of the DIT or an attribute.
AMObject
AMObject provides basic methods to manage identity-related objects. Since this is a generic class, it does not have any Templates (defined in "Object Templates") associated with it.
AMOrganization
The AMOrganization interface provides the methods used to manage organizations. Associated with this interface are the following ums.xml Templates that define its behavior at runtime. The name of the structural template used by this class is Organization; the name of the creation template used is BasicOrganization, and the name of the search template is BasicOrganizationSearch.
AMOrganizationalUnit
The AMOrganizationalUnit interface provides the methods used to manage organizational units. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The name of the structural template used by this class is OrganizationalUnit; the name of the creation template used is BasicOrganizationalUnit, and the name of the search template is BasicOrganizationalUnitSearch.
AMPeopleContainer
The AMPeopleContainer interface provides the methods used to manage people containers. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The name of the structural template used by this class is PeopleContainer; the name of the creation template used is BasicPeopleContainer, and the search template is BasicPeopleContainerSearch.
AMGroupContainer
The AMGroupContainer interface provides the methods used to manage group containers. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The name of the structural template used by this class is GroupContainer; the name of the creation template used is BasicGroupContainer, and the search template is BasicGroupContainerSearch.
AMGroup
The AMGroup interface provides the methods used to manage groups. This is the basic class for all derived groups, such as static groups, dynamic groups and assignable dynamic groups. No default templates are defined for this class.
AMStaticGroup
The AMStaticGroup interface provides the methods used to manage static groups. This class extends the base AMGroup interface. The name of the creation template used with this class is BasicGroup; and the search template used is BasicGroupSearch. It does not have a pre-defined structural template.
AMDynamicGroup
The AMDynamicGroup interface provides the methods used to manage dynamic groups. This class extends the base AMGroup interface. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The creation template used is named BasicDynamicGroup; and the search template used is named as BasicDynamicGroupSearch. It does not have a pre-defined structural template.
AMAssignableDynamicGroup
The AMAssignableDynamicGroup interface provides the methods used to manage assignable dynamic groups. This class extends the base AMGroup interface. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The creation template used is named BasicAssignableDynamicGroup; and the search template used is named BasicAssignableDynamicGroupSearch. It does not have a pre-defined structural template.
AMRole
The AMRole interface provides the methods used to manage roles. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The creation template used is named BasicManagedRole; and the search template used is named BasicManagedRoleSearch. It does not have a pre-defined structural template.
AMUser
The AMUser interface provides the methods used to manage users. Associated with this object are the following ums.xml Templates that define its behavior at runtime. The creation template used is named BasicUser; and the search template used is named BasicUserSearch. It does not have a pre-defined structural template.
AMTemplate
The AMTemplate interface represents a service template associated with a AMObject. Identity Server distinguishes between virtual and entry attributes. Per Sun ONE Directory Server terminology, a virtual attribute is an attribute not physically stored in an LDAP entry but still returned with it as a result of a LDAP search. Virtual attributes are analogous to inherited attributes. Entry attributes are non-inherited attributes.
Note
More information on virtual attributes can be found in "Virtual Attribute" of Appendix B "Directory Server Concepts."
For AMOrganization, AMOrganizationalUnit and AMRole, virtual attributes can be grouped in a Template on a per-service basis; there may be one service Template for each service for any given AMObject. Such templates determine the service attributes inherited by the users within the scope of this object. There are three types of templates: POLICY_TEMPLATE, DYNAMIC_TEMPLATE and ORGANIZATION_TEMPLATE. POLICY_TEMPLATE and DYNAMIC_TEMPLATE are implemented using CoS Templates; ORGANIZATION_TEMPLATE does not have virtual attributes.
Template Priority
When any object inherits more than one template for the same service (by virtue of being in the scope of two or more objects with service templates), the conflict is resolved through template priorities. In this priority scheme, zero is the highest possible priority with the lower priorities extending towards infinity. Templates with higher priorities will be favored over and to the exclusion of templates with lower priorities. Templates which do not have an explicitly assigned priority are considered to have the lowest priority possible, or no priority. In the case where two or more templates are being considered for inheritance of an attribute value, and they have the same (or no) priority, the result is undefined, but does not exclude the possibility that an arbitrarily chosen value will be returned.
AMStoreConnection
The AMStoreConnection class represents a connection to the Identity Server data store; the Identity Server data store is the Directory Server. This class controls and manages access to the Directory Server by providing methods to create, remove and get different types of identity-related objects. A SSOToken is required in order to instantiate a AMStoreConnection object.
The SDK And Cache
Caching in the Identity Server SDK is used for storing all AMObject attributes (i.e., attributes of identity-related objects) that are retrieved from the Directory Server. The cache does not hold AMObject directly, only its attributes. All attributes retrieved from the Directory Server using the interface methods AMObject.getAttributes(), AMObject.getAttribute(String name) or AMObject.getAttributes(setAttributeNames) will be cached.
Cache Properties
The following cache properties can be configured by accessing the AMConfig.properties file. They are:
com.iplanet.services.stats.stateDepending on whether this property is set to file or console, the cache statistics will be printed to either a amSDKStats file or the Identity Server console.
com.iplanet.services.stats.directoryThe value of this property is the directory in which the amSDKStats file is created.
com.iplanet.am.statsIntervalThe interval at which cache statistics are printed can be specified as the value of this property. It indicates the number of seconds after which the stats will be printed. For example, a value of 3600 would cause the cache statistics to be printed after 3600 seconds. This will be used only if com.iplanet.services.stats.state is set to file or console. Table 5-1 is explains the information that is recorded in the statistics files.
Table 5-1    Recorded Cache Properties
Information Name
What is recorded
Installing the SDK Remotely
It is possible for an external application to perform management functions on the Identity Server data store (Directory Server) without installing the full Identity Server application at the external location. By installing the SUNWamsdk package using the pkgadd utility and answering NO to the first question, "Install the remote client only", the full SDK will be installed. Answering YES, the Identity Server SDK can be installed on a non-Identity Server machine.
amEntrySpecific.xml
The purpose of the amEntrySpecific.xml service file is to define the attributes that will display on the Create, Properties and Search pages specific to each of the Identity Server abstract objects. Each Identity Server abstract object can have its own schema definition in the amEntrySpecific.xml file which is based on the sms.dtd as described in Chapter 6 "Service Management."
amEntrySpecific.xml Schema
Each abstract object can have a schema defined in the amEntrySpecific.xml file. The schema defines what attributes will be displayed on the function pages used to manage abstract type objects:
CreateThe Create page is displayed when the administrator clicks New.
PropertiesThe Properties Page is displayed when the Properties icon (an arrow in a box) next to an abstract type object is clicked.
SearchThe Search link is in the top left frame of the Identity Server console. If a service developer wants to customize these Identity Server function pages for any of the abstract objects, they would need to modify the amEntrySpecific.xml. For example, to display an attribute on the group page, the new attribute needs to be added to the amEntrySpecific.xml file. Any abstract object with customized attributes in the Directory Server would need to have those attributes reflected in the amEntrySpecific.xml file also. (Most often, a service developer would only be customizing the organization pages.) Code Example 5-1 is the organization attribute subschema that defines the display of an organization's Organization Status and its choice values.
If the type attribute is not specified in amEntrySpecific.xml, the defaults will be used. A default setting means that only the name of the entry will display on the object function pages in the Identity Server console.
All the attributes listed in the schema definitions in the amEntrySpecific.xml file are displayed when the abstract type object pages are displayed. If the attribute is not listed in a schema definition in the amEntrySpecific.xml file, the Identity Server console will not display the attribute. For additional information on the Identity Server abstract objects and marker object classes, see the Sun ONE Identity Server Installation and Configuration Guide.
Note
The User service is not configured in the amEntrySpecific.xml file but in its own amUser.xml file.
Management Sample Functions
Following are several samples that illustrate identity management functions using the Identity Server.
Create, Delete Or Modify Users
Users can be created, deleted or modified can be accomplished using the SDK. There is an interface that can be called for any SDK user creation, deletion, or modification. The property com.iplanet.am.sdk.userEntryProcessingImpl should be set to the implementation in AMConfig.properties.
Create Organization
The following code sample creates a new organization with one user by opening a connection to the Directory Server with AMStoreConnection. A new top organization (newtoporg.com) is then created with its own attributes. User John Smith is also created as a member of the new organization.
Retrieve Templates
The following code sample retrieves a service's dynamic templates by opening a connection to the Directory Server with AMStoreConnection. It retrieves a service's dynamic template by defining the DN of the top organization (toporg.com) as well as the string attribute of the specific service to be retrieved.
Create Users With Modified LDAP Schema
There might be a need to modify the Directory Server schema in order to create users with non-default object classes. Here are the steps to create users with extended object classes:
Modify Directory Schema with the new set of attributes and object classes.
For more information on this function, see the Sun ONE Directory Server documentation.
Write a new XML service file which contains the definitions for the new object classes and attributes.
When writing this file, the object classes should be defined under the Global element and the attributes should be defined under the User element. More information can be found in Chapter 6 "Service Management."
Write a new module configuration properties file.
This file contains the key-value pairs for the internationalization keys used in the file created in Step 2. More information can be found in "Configuring Module Credential Requirements" of Chapter 3 "Authentication Service."
Load the two files using the amadmin command line interface.
More information on this tool can be found in the Sun ONE Identity Server Administration Guide.
Restart the Directory Server and Identity Server.
Register the new service to the desired organization using the Console.
For getting more details about registering a new service, refer to the Sun ONE Identity Server Administration Guide.
Select the new service to create a user with the additional object classes.
When creating new user there is an option to select the newly configured service.
Previous Contents Index Next
Copyright 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated December 02, 2002