com.tivoli.am.eb.web.eaidemo
Class AdvancedEAIDemoServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.tivoli.am.eb.web.eaidemo.AbstractEAIDemoServlet
              extended by com.tivoli.am.eb.web.eaidemo.AdvancedEAIDemoServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class AdvancedEAIDemoServlet
extends AbstractEAIDemoServlet

The advanced EAI demo servlet performs authentication through the TAM Java Authentication API by generating a PAC for the user corresponding to the tam-eai-user servlet context parameter. The user ID entered in the EAI login form is set as an extended attribute and returned in the response headers for requests made of this servlet. In order for this servlet to function correctly, the location of PdPerm.properties must be set in the jrte-cfg-url servlet context parameter. Additionally, the JRE must be configured for use with TAM by running PdJrteCfg and SvrSslCfg. See the WebSphere documentation for enabling use with Tivoli Access Manager for the proper usage of the PdJrteCfg and SvrSslCfg commands.

Author:
Tivoli Systems
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.tivoli.am.eb.web.eaidemo.AbstractEAIDemoServlet
config, ORIG_USER_ATTR_NAME
 
Constructor Summary
AdvancedEAIDemoServlet()
          Constructs a new advanced demo servlet.
 
Method Summary
protected  java.lang.Object doAuthentication(javax.servlet.http.HttpServletRequest req)
          Performs authentication against a the registry configured in the PDJRTE for this server.
protected  void doEAIHeaders(java.lang.Object principal, javax.servlet.http.HttpServletResponse resp)
          Sets the appropriate user ID headers in the response to the client.
 void init()
          Initializes the PDAuthorizationContext, preparing the servlet for authentication requests.
 
Methods inherited from class com.tivoli.am.eb.web.eaidemo.AbstractEAIDemoServlet
doPost, getDeclaredAuthLevel, getDeclaredTamUser, getRequestedUrl
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdvancedEAIDemoServlet

public AdvancedEAIDemoServlet()
Constructs a new advanced demo servlet.

Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initializes the PDAuthorizationContext, preparing the servlet for authentication requests.

Overrides:
init in class AbstractEAIDemoServlet
Throws:
javax.servlet.ServletException - if the server is misconfigured

doAuthentication

protected java.lang.Object doAuthentication(javax.servlet.http.HttpServletRequest req)
                                     throws java.lang.Exception
Performs authentication against a the registry configured in the PDJRTE for this server. All user IDs entered into the EAI login form are mapped to a common TAM user ID. This user ID can be configured by changing the context parameter tam-eai-user. The user ID mapping is implemented through EAI extended attributes.

Specified by:
doAuthentication in class AbstractEAIDemoServlet
Parameters:
req - The HTTP request containing login data from the EAI login form.
Returns:
A Principal (of type com.tivoli.pd.jazn.PDPrincipal) generated from the PDJRTE. This method will return null if no login data was found.
Throws:
java.lang.Exception - If there was a problem authenticating the user through the PDJRTE.

doEAIHeaders

protected void doEAIHeaders(java.lang.Object principal,
                            javax.servlet.http.HttpServletResponse resp)
Sets the appropriate user ID headers in the response to the client. Headers set will be: eai-pac, and eai-redir-url. If a header is not configured in the web.xml file for this application, it will not be included in the response.

Specified by:
doEAIHeaders in class AbstractEAIDemoServlet
Parameters:
principal - The user information returned from doAuthentication()
resp - The HTTP response that will be sent to the client


Copyright © 2004 IBM Corp. All Rights Reserved.