Before you begin
Before you perform this task, it is assumed that you already have a custom user registry implemented and working with WebSphere Application Server Version 6. The custom registry interface is the UserRegistry interface.In WebSphere Application Server Version 6.0.x, in addition to the UserRegistry interface, the custom user registry requires the Result object to handle user and group information. This file is already provided in the package and you are expected to use it for the getUsers, getGroups and the getUsersForGroup methods.
You cannot use other WebSphere Application Server components (for example, datasources) to initialize the custom registry because other components like the containers are initialized after security and are not available during the registry initialization. A custom registry implementation is a pure custom implementation, independent of other WebSphere Application Server components.
The EJB method getCallerPrincipal( ) and the servlet methods getUserPrincipal( ) and getRemoteUser( ) return the security name instead of the display name. However, if you need the display names to return, set the WAS_UseDisplayName property to true. See the getUserDisplayName method description or the Javadoc, for more information.
If the migration tool was used to migrate the WebSphere Application Server Version 5 configuration to WebSphere Application Server Version 6.0.x, be aware that this migration does not involve any changes to your existing code. Because the WebSphere Application Server Version 5 custom registry works in WebSphere Application Server Version 6.0.x without any changes to the implementation (except when using data sources) you can use the Version 5-based custom registry after the migration without modifying the code. Consider that the migration tool might not copy your implementation files from Version 4 to Version 6.0.x. You might have to copy them to the class path in the Version 6 setup (preferably to the classes subdirectoy). If you are using the WebSphere Application Server Network Deployment version, copy the files to the cell and to each of the nodes class paths.
Before proceeding, look at the UserRegistry interface. See Developing custom user registries for a description of each of these methods in detail.
Why and when to perform this task
The following steps go through in detail all the changes required to move your WebSphere Application Server Version 5 custom user registry to the WebSphere Application Server Version 6.0.x custom user registry. The steps are very simple and involve minimal code changes. The sample implementation file is used as an example when describing some of the steps.Steps for this task
public class FileRegistrySample implements CustomRegistry
to
public class FileRegistrySample implements UserRegistry
public String mapCertificate(X509Certificate cert)
to
public String mapCertificate(X509Certificate[]cert)
public List getUsers(String pattern)
to
public Result getUsers(String pattern, int limit)
public List getUsersForGroup(String groupName)
throws CustomRegistryException,
EntryNotFoundException {
public Result getUsersForGroup(String groupSecurityName, int limit)
throws NotImplementedException,
EntryNotFoundException,
CustomRegistryException {
public List getGroups(String pattern)
topublic Result getGroups(String pattern, int limit)
In your implementation, construct the Result object from the list of the groups obtained from the registry (whose number is limited to the value of the limit parameter) and call the setHasMore() method on the Result object if the total number of groups in the registry exceeds the limit value.
public com.ibm.websphere.security.cred.WSCredential
createCredential(String userSecurityName)
throws CustomRegistryException,
NotImplementedException,
EntryNotFoundException {
return null;
}
The first and second lines of the previous code example normally appear on one line. However, it extended beyond the width of the page.
%install_root%\java\bin\javac -classpath %WAS_HOME%\lib\wssec.jar;
%WAS_HOME%\lib\sas.jar FileRegistrySample.java
Result
Migrates to a WebSphere Application Server Version 6.0.x custom registry.Example
This step is required to migrate a custom registry from WebSphere Application Server Version 5 to WebSphere Application Server Version 6.0.x.
What to do next
If you are enabling security, make sure you complete the remaining steps. Once completed, save the configuration and restart all the servers. Try accessing some J2EE resources to verify that the custom registry migration was successful.Related concepts
Custom user registries
Related tasks
Developing custom user registries
Related reference
UserRegistry.java files
FileRegistrySample.java file