Sun Open Telecommunications Platform 2.0 Developer's Guide

Extending Web SSO Core With New Authentication Module

For every web application that needs to be integrated with Web SSO, you have to implement the new authentication module. You have to modify the Web SSO core, that is, add and embed the new authentication module into the code.

The authentication module should extend the com.sun.otp.websso.AuthModule abstract class. The following listing illustrates it:

package com.sun.otp.websso.xxx;

import com.sun.otp.websso.AuthModule;
import com.sun.otp.websso.SunClusterUtils;
import com.sun.otp.websso.Util;
import com.sun.otp.websso.configuration.ConfigItem;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.servlet.ServletContext;
import javax.servlet.http.Cookie;

/*******************************************************************************
 * Authentication module for XXX application.
 */
public class SpsAuth extends AuthModule {
    
    /**************************************************************************/
    private static final String XXX_COOKIE = "XXXCookie";
    
    /***************************************************************************
     * Creates new instance of authentication module for N1 SPS.
     * @param config  configuration information for this module
     * @param context  servlet context
     */
    public SpsAuth(ConfigItem config, ServletContext context) {
        super(config, context);
        log("XXX: "+protocol+", "+server+", "+port);
    }
    
    /***************************************************************************
     * Performs login into XXX application.
     * @param username  user's name
     * @param password  user's password
     * @return  array of cookies obtained from Lockhart that should be stored in 
user's browser     */
    public Cookie[] login(String username, String password) throws Exception {
     //connect to XXX application, provide credentials, and return cookies
    }

    /***************************************************************************
     * Performs logout from XXX application.
     * @return  array of cookies that should be updated (deleted) in 
user's browser     */
    public Cookie[] logout() throws Exception {
     //connect to XXX application, do logout, and return cookies that 
should be updated/deleted
}

For filter API details, see package javax.servlet. Also see source code, for example, src/websso/filter/. For more information, see Java Platform Enterprise Edition, v 5.0 API Specifications.