+

Search Tips   |   Advanced Search

Develop a custom thread identity service

We can develop a custom thread identity service class by implementing the com.ibm.wsspi.kernel.security.thread.ThreadIdentityService interface that is provided in the Liberty profile server. The ThreadIdentityService interface is a Service Programming Interface (SPI) that enables support to receive notifications of user identity switches.

  1. Create a custom thread identity service by implementing the ThreadIdentityService interface.

  2. Convert the implementation class into an OSGi service. We can do the conversion in either of two ways:

    1. Convert the ThreadIdentityService class into a Declarative Service (DS) component.

      See Declaring the services to OSGi Declarative Services.

    2. Write a new ThreadIdentityService class that is a DS component and delegate it to the ThreadIdentityService class. Register the ThreadIdentityService class directly in the Service Registry (SR) using the OSGi core APIs.

      See Work with the OSGi service registry.

  3. Package the custom thread identity service as an OSGi bundle and export the ThreadIdentityService service. For information on creating an OSGi bundle, see .

  4. Create a feature manifest to include the OSGi bundle.

    See Product extension.

  5. After the feature is installed into the user product extension location, configure the server.xml file with the feature name.
    <featureManager>
     ... 
      <feature>usr:sampleThreadIdentityService-1.0</feature>
    </featureManager>


Parent topic: Develop extensions to the Liberty profile security infrastructure

Concepts:

  • Product extension

    Tasks:

  • Work with the OSGi service registry
  • Declaring the services to OSGi Declarative Services

    Reference:

  • Liberty feature manifest files