Using Actuate Information Console security : Creating a custom security adapter : Creating a custom security adapter class

Creating a custom security adapter class

Extend the iPortal Security Adapter class to customize authentication. The iPortal Security Extension requires access to the following libraries:

n  
n  

iPortalSecurityAdapter provides a set of empty methods. Extend this class and override any of the methods to provide custom IPSE authentication. To establish a secure session with Information Console using a custom security adapter, the following methods are required:

n  
n  
n  
n  
n  

The login module of Information Console calls methods in the custom security class to perform authentication and to retrieve login credentials to pass to iServer. The authenticate( ) method returns a boolean value to indicate whether the login credentials provided are acceptable. The getter methods return the credentials that iServer requires. Each user name and password must correspond to an authentic user account on the volume configured by the volume profile. For example, to support a URL that authenticates using a single parameter, code, override authenticate( ) to retrieve the parameter from the HttpServletRequest and set the user name, password, and volumeProfile as in the following class:

import javax.servlet.http.*;
import com.actuate.iportal.security.iPortalSecurityAdapter;
 
public class SecurityCode extends com.actuate.iportal.security.iPortalSecurityAdapter {
  private String volumeProfile = "CustomAccess";
  private String userName = null;
  private String password = null;
 
  public SecurityCode( ) {}
 
  public boolean authenticate( HttpServletRequest httpservletrequest) {
    String param = httpservletrequest.getParameter("code");
    boolean secured = true;
    if ("12345".equalsIgnoreCase( param )) {
      userName = "user1";
      password = "user1";
    }
    else if ("abc".equalsIgnoreCase( param )) {
      userName = "BasicUser";
      password = "";
    }
    else {
      secured = false;
    }
    return secured;
  }
  public String getUserName() { return userName; }
  public String getPassword() { return password; }
  public String getVolumeProfile() { return volumeProfile; }
}

If there is a user "user1" with the password "user1" on the volume configured by the volume profile "CustomAccess," a valid URL that authenticates user1 using this security adapter is as follows:

http://localhost:8700/iportal/getfolderitems.do?code=12345

(c) Copyright Actuate Corporation 2011