atg.servlet.pipeline
Class BasicAuthenticationPipelineServlet

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.BasicAuthenticationPipelineServlet
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class BasicAuthenticationPipelineServlet
extends PipelineableServletImpl

This pipeline servlet implements Basic authentication. If the request comes in bearing an Authorization header with Basic authentication, then this servlet consults an Authenticator to see if the specified id/password is authenticated, and passes the request on if so. If not, then a challenge is issued using the specified realm property.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
BasicAuthenticationPipelineServlet()
          Constructs a new BasicAuthenticaionPipelineServlet
 
Method Summary
 void doStartService()
          Initialize the prefix-to-authenticator correspondence arrays, if needed, on initialization.
 java.lang.String getAuthenticateHeaderValue()
          Returns the header value for the authentication header
 Authenticator getAuthenticator()
          Returns the authenticator used to verify id/password combinations
 boolean getEnabled()
          Is authentication enabled?
 boolean getLogFailedAuthentications()
          Retturns true if informational log messages will be emitted whenever authentication for the request fails, false if no logging will be performed.
 boolean getLogSuccessfulAuthentications()
          Returns true if informational log messages will be emitted whenever a user is authenticated, false if no logging will be performed.
 ServiceMap getPathAuthenticatorMap()
          Gets the path authenticator map.
 java.lang.String getRealm()
          Returns the realm that will be displayed to the user in the authentication request.
 java.lang.String getUnauthorizedMessage()
          Returns the HTML message that will be displayed to the user if authentication fails.
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Services a DynamoHttpServletRequest/Response pair
 void setAuthenticator(Authenticator pAuthenticator)
          Sets the authenticator used to verify id/password combinations
 void setEnabled(boolean pEnabled)
          Returns the enabled flag for authentication.
 void setLogFailedAuthentications(boolean pDoLog)
          If true, informational log messages will be emitted whenever authentication for the request fails.
 void setLogSuccessfulAuthentications(boolean pDoLog)
          If set to true, informational log messages will be emitted whenever a user is authenticated.
 void setPathAuthenticatorMap(ServiceMap pMap)
          Sets the path authenticator map.
 void setRealm(java.lang.String pRealm)
          Sets the realm that will be displayed to the user in the authentication request.
 void setUnauthorizedMessage(java.lang.String pUnauthorizedMessage)
          Sets the HTML message that will be displayed to the user if authentication fails.
 
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
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

BasicAuthenticationPipelineServlet

public BasicAuthenticationPipelineServlet()
Constructs a new BasicAuthenticaionPipelineServlet

Method Detail

getRealm

public java.lang.String getRealm()
Returns the realm that will be displayed to the user in the authentication request.


setRealm

public void setRealm(java.lang.String pRealm)
Sets the realm that will be displayed to the user in the authentication request.


getAuthenticateHeaderValue

public java.lang.String getAuthenticateHeaderValue()
Returns the header value for the authentication header


getAuthenticator

public Authenticator getAuthenticator()
Returns the authenticator used to verify id/password combinations


setAuthenticator

public void setAuthenticator(Authenticator pAuthenticator)
Sets the authenticator used to verify id/password combinations


setPathAuthenticatorMap

public void setPathAuthenticatorMap(ServiceMap pMap)
Sets the path authenticator map.


getPathAuthenticatorMap

public ServiceMap getPathAuthenticatorMap()
Gets the path authenticator map.


getEnabled

public boolean getEnabled()
Is authentication enabled?


setEnabled

public void setEnabled(boolean pEnabled)
Returns the enabled flag for authentication.


getLogSuccessfulAuthentications

public boolean getLogSuccessfulAuthentications()
Returns true if informational log messages will be emitted whenever a user is authenticated, false if no logging will be performed.

Default is false.


setLogSuccessfulAuthentications

public void setLogSuccessfulAuthentications(boolean pDoLog)
If set to true, informational log messages will be emitted whenever a user is authenticated.


getLogFailedAuthentications

public boolean getLogFailedAuthentications()
Retturns true if informational log messages will be emitted whenever authentication for the request fails, false if no logging will be performed.

Default is true.


setLogFailedAuthentications

public void setLogFailedAuthentications(boolean pDoLog)
If true, informational log messages will be emitted whenever authentication for the request fails.


getUnauthorizedMessage

public java.lang.String getUnauthorizedMessage()
Returns the HTML message that will be displayed to the user if authentication fails.


setUnauthorizedMessage

public void setUnauthorizedMessage(java.lang.String pUnauthorizedMessage)
Sets the HTML message that will be displayed to the user if authentication fails.


doStartService

public void doStartService()
                    throws ServiceException
Initialize the prefix-to-authenticator correspondence arrays, if needed, on initialization.

Overrides:
doStartService in class GenericService
Throws:
ServiceException - if the Service had a problem starting up

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws java.io.IOException,
                    javax.servlet.ServletException
Services a DynamoHttpServletRequest/Response pair

Overrides:
service in class PipelineableServletImpl
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request