
This process refers to developing the login modules. It describes the activities you must perform later to set up the login modules stack in the Security Provider Service and how you reference the login modules from your Web application.
As far as the development of login modules is concerned, you use the standard JAAS APIs and a few SAP proprietary classes to program their functions. The process flow is outlined in the next section. The SAP proprietary classes are described in the SAP Specific HTTP Callbacks .
Each login module must implement the javax.security.auth.spi.LoginModule interface that define five methods:
You can use any of the policy configuration templates and their authentication stacks as a basis for enhancing them to develop your custom authentication templates. For more information about the template login modules provided, see Managing Authentication Policy .
Code to Use in Your Web Application
To perform the authentication using the login modules that you have developed, you must do the following in your servlet or JSP code:
LoginContext lc = new LoginContext("Example");where Example is the name of the login modules stack as you defined it in step 3 of the above process.
try {
// start authentication
lc.login();
// user authenticated successfully
} catch (LoginException le) {
// handle the cases of failed authentication here
…
}