Develop a custom user registry for the Liberty profile
We can develop a custom user registry class by implementing the com.ibm.websphere.security.UserRegistry interface provided in the Liberty profile server.
The UserRegistry interface is a Service Programming Interface (SPI) that enables support to virtually any type of account repository. For a general view of stand-alone custom registries, see Stand-alone custom registries.
- Implement the custom user registry.
See Developing the UserRegistry interface for using custom registries.
- Convert the implementation class into an OSGi service. We can do the conversion in the following ways:
- Convert the UserRegistry class into a Declarative Service (DS) component.
See Declaring the services to OSGi Declarative Services.
- Write a new UserRegistry class that is a DS component and delegate it to the UserRegistry class.
- Register the UserRegistry class directly in the Service Registry (SR) using the OSGi core APIs.
- Package the custom user registry as an OSGi bundle and export the UserRegistry service. For information on creating an OSGi bundle, see Creating an OSGi service bundle.
- Create a feature manifest to include the OSGi bundle.
See Product extension.
- After the feature is installed into the user product extension location, configure server.xml with the feature name. For example:
<featureManager> ... <feature>usr:customRegistrySample-1.0</feature> </featureManager>For a downloadable custom user registry sample, see https://developer.ibm.com/wasdev/downloads/#asset/samples-Custom_User_Registry.
See https://www.ibmdw.net/wasdev/docs/creating-a-custom-user-registry-as-a-liberty-user-feature/.
Parent topic: Develop extensions to the Liberty profile security infrastructureConcepts:
Product extension Tasks:
Work with the OSGi service registry Declaring the services to OSGi Declarative Services Reference:
Liberty feature manifest files Related information:
Custom User Registry
Create a custom user registry as a Liberty user feature