Developing user-defined login modules for Teracloud® Streams
Use this procedure and the sample login module that is installed with Teracloud® Streams to develop your own customized login module.
The Teracloud® Streams sample login module is located in the $STREAMS_INSTALL/samples/security/ directory.
Before you begin
The following software is required to create and package a customized login module:
- Apache Ant 1.9 or the latest stable version, which is available on the Apache Ant Project website.
- bnd 2.4.1.
Procedure
- Implement a standard javax.security.auth.spi.LoginModule interface.
For instructions, see the following Java™ Authentication and Authorization Service (JAAS) documentation on the Oracle Java™ Platform Standard Edition 8 Documentation website:Teracloud® Streams provides an SPI OSGi bundle (com.ibm.streams.security.authc.jar) for adding the following user and group principals that are specific to Teracloud® Streams into the authenticated subject when authentication is successful:
- com.ibm.streams.security.authc.UserPrincipal
- com.ibm.streams.security.authc.GroupPrincipal
For more information, see the sample login module in the $STREAMS_INSTALL/samples/security/ directory.
- Compile and package the implementation class files into
an OSGi bundle.
- Run the Teracloud®
Streams streamsprofile.sh script
by entering the following command:
source product-installation-root-directory/7.2.0.0/bin/streamsprofile.sh - Run the Ant build.xml script by entering
the following command:
ant
This command creates the OSGi .jar file for the customized login module in the build/bundles directory. - Configure Teracloud®
Streams to
use the login module.