atg.svc.clicktoconnect
Class AuthenticationServlet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.servlet.pipeline.PipelineableServletImpl
                  extended by atg.servlet.pipeline.InsertableServletImpl
                      extended by atg.svc.clicktoconnect.AuthenticationServlet
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.servlet.pipeline.InsertableServlet, atg.servlet.pipeline.PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class AuthenticationServlet
extends atg.servlet.pipeline.InsertableServletImpl

This servlet will auto-login the username provided with the C2CRequestData. Hash values are compared prior to auto-login


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  C2CTools mC2CTools
           
protected  atg.userprofiling.ProfileServices mProfileServices
           
protected  atg.userprofiling.ProfileTools mProfileTools
           
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
AuthenticationServlet()
           
 
Method Summary
 C2CTools getC2CTools()
          get C2CTools
 atg.userprofiling.ProfileServices getProfileServices()
          get ProfileServices
 atg.userprofiling.ProfileTools getProfileTools()
          get ProfileTools
 boolean handleLogin(java.lang.String pLogin, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          handleLogin authenticates a user based on the supplied username.
protected  boolean isDoService(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Returns true if the conditions are correct for the servlet to execute.
 boolean isEnabled()
          get Enabled
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          service the request
 void setC2CTools(C2CTools pTools)
          set C2CTools
 void setEnabled(boolean pEnabled)
          set Enabled
 void setProfileServices(atg.userprofiling.ProfileServices pProfileServices)
          Set ProfileServices
 void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
          set ProfileTools
 
Methods inherited from class atg.servlet.pipeline.InsertableServletImpl
doStartService, getInsertAfterServlet, setInsertAfterServlet
 
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, doStopService, getAbsoluteName, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface atg.servlet.pipeline.PipelineableServlet
getNextServlet, passRequest, setNextServlet
 
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init, service
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mC2CTools

protected C2CTools mC2CTools

mProfileServices

protected atg.userprofiling.ProfileServices mProfileServices

mProfileTools

protected atg.userprofiling.ProfileTools mProfileTools
Constructor Detail

AuthenticationServlet

public AuthenticationServlet()
Method Detail

getC2CTools

public C2CTools getC2CTools()
get C2CTools

Returns:
the C2CTools

setC2CTools

public void setC2CTools(C2CTools pTools)
set C2CTools

Parameters:
pTools - the C2CTools

setProfileServices

public void setProfileServices(atg.userprofiling.ProfileServices pProfileServices)
Set ProfileServices

Parameters:
pProfileServices - the ProfileServices

getProfileServices

public atg.userprofiling.ProfileServices getProfileServices()
get ProfileServices

Returns:
the ProfileServices

setProfileTools

public void setProfileTools(atg.userprofiling.ProfileTools pProfileTools)
set ProfileTools

Parameters:
pProfileTools - the ProfileTools

getProfileTools

public atg.userprofiling.ProfileTools getProfileTools()
get ProfileTools

Returns:
the ProfileTools

setEnabled

public void setEnabled(boolean pEnabled)
set Enabled

Parameters:
pEnabled - the Enabled

isEnabled

public boolean isEnabled()
get Enabled

Returns:
the Enabled

isDoService

protected boolean isDoService(atg.servlet.DynamoHttpServletRequest pRequest,
                              atg.servlet.DynamoHttpServletResponse pResponse)
Returns true if the conditions are correct for the servlet to execute. If false, servlet is a no-op.

To return true, the servlet must be enabled, session not logged in yet, c2cRequestInitialization parameter must be on the request, C2CRequestData must be present on the session, a username must be provided on the C2CRequestData and the hash values must successfully compare.

Parameters:
pRequest -
pResponse -
Returns:
boolean
See Also:
isEnabled(), C2CTools.isLoggedIn(), C2CTools.compareHash(C2CRequestData)

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
service the request

Overrides:
service in class atg.servlet.pipeline.PipelineableServletImpl
Throws:
java.io.IOException
javax.servlet.ServletException

handleLogin

public boolean handleLogin(java.lang.String pLogin,
                           atg.servlet.DynamoHttpServletRequest pRequest,
                           atg.servlet.DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException
handleLogin authenticates a user based on the supplied username.

Parameters:
pLogin - the username of the agent wishing to login
pRequest - the current request
pResponse - the current response
Returns:
a boolean value, true returned if login was successful, false if the login was unsuccessful
Throws:
javax.servlet.ServletException - if something went wrong