Software AG Infrasructure 10.7 | Setting Up Security | Creating Login Modules
Creating Login Modules
Security Infrastructure consists of a set of bundles located in the Software AG_directory \common\runtime\bundles\platform\eclipse\plugins directory. Security Infrastructure bundle names start with All interfaces and common classes are contained in
You can create login modules by copying predefined modules and modifying the copies.
All LoginModules must extend the SagAbstractLoginModule. This class is an abstract superclass for all Security Infrastructure LoginModules. It handles the retrieval of credentials for all derived classes and the handling of the inter-LoginModule SSO. Derived classes have to implement initConfiguration () and authenticate (). See the Security Infrastructure Javadoc for details.
When you extend the SagAbstractLoginModule, do not overwrite the initialized () method. If you need to overwrite it (for example, when you use a new Callback and CallbackHandler), explicitly invoke the super.initialize () method instead. This prevents the failure of other Security Infrastructure-based login modules.
To write a LoginModule using SagAbstractLoginModule, define the parameters for the new module. Extend SagAbstracLoginModule with main focus on the implementation of initConfiguration () and authenticate (). The first method gets the incoming parameters from the JAAS configuration file in the following way:
String optionValue = (String) options.get(OPTION_VALUE);
The second method takes care of the actual authentication of the user. It is called by the login () method from the SagAbstracLoginModule. You can modify the user credentials according to the inter-LoginModule SSO.
If you want to implement other methods from the SagAbstracLoginModule (for example, logout() or commit()), it is a good idea to invoke the super method from the parent class at the end.