|
User Management Guide |
This chapter describes how to manage user profiles, which contain user-specific information such as attributes and preferences that is stored in the application database, rather than the realm. This chapter has these sections:
For an overview of user profiles, see
About profiles.
User profiles are stored in the application database and thus persist across application deployments. The database in which user profiles are stored is completely independent from the authentication realm. In other words, although user profiles typically correspond to authenticated application users, this is not a requirement. The actual purpose and use of profiles depends on the design of your application.
The Custom Web app provided with the Portal subsystem is designed to work with a writable realm. The New User component allows anonymous users to add themselves to the realm. It automatically creates a profile for each user added to the writable realm. You can change the New User component or design a new one.
For example, consider an application that uses only a readable realm. That application could maintain profiles only for authenticated users who actually log in, or it could maintain a profile for every user in the realm regardless of their use of the application.
It is also possible to create profiles that do not correspond to authenticated users. For example, the default profile database contains one such profile. It provides a "sample" profile for educational purposes that has no corresponding user except by coincidence.
Director provides built-in facilities for managing user profiles:
The PAC has a Profiles section, as described in Using the Profiles Section of the PAC.
The New User component creates profiles for authenticated users, as described in Using the New User component.
If your application has different requirements, it can manage user profiles using the User subsystem API as described in Using the User API.
The New User component is one of the core components used in the custom Web App. You can use it as a template in your own application.
The New User component does the following:
Adds a username and password to the writable realm (if enabled)
Creates a user profile identified by the combination of the user's realm name and an automatically generated 32-bit UUID
The source file for the New User component is in your Director project directory:
Portal\WEB-INF\lib\portal-core-resource\src\com\sssw\portal\
component\core\NewUserComponent.java
This code shows how the New User component adds a user profile.
//
// Get a profile delegate from the user service
//
EbiUserDelegate userDelegate =
com.sssw.fw.usermgr.client.EboFactory.getUserDelegate();
//
// Instantiate an empty profile object for this user
//
EbiUserInfo userInfo = (EbiUserInfo)userDelegate.createUserInfo();
//
// Add profile info (default attributes) for the user
//
userInfo.setUserID(m_uid);
userInfo.setUserFirstName(m_firstName);
userInfo.setUserLastName(m_lastName);
userInfo.setUserEmailAddress(m_email);
userInfo.setUserAuthenticatedRealmName(dirService.getPrimaryRealmName());
//
// Add the new profile
//
boolean status = userDelegate.createUser(context, userInfo);
|
User Management Guide |
Copyright © 2002, SilverStream Software, LLC, a wholly owned subsidiary of Novell, Inc. All rights reserved.