| java.lang.Object org.apache.catalina.valves.ValveBase org.apache.catalina.authenticator.AuthenticatorBase
All known Subclasses: org.apache.catalina.authenticator.NonLoginAuthenticator, org.apache.catalina.authenticator.FormAuthenticator, org.apache.catalina.authenticator.DigestAuthenticator, org.apache.catalina.authenticator.BasicAuthenticator, org.apache.catalina.authenticator.SSLAuthenticator,
AuthenticatorBase | abstract public class AuthenticatorBase extends ValveBase implements Authenticator,Lifecycle(Code) | | Basic implementation of the Valve interface that enforces the
<security-constraint> elements in the web application
deployment descriptor. This functionality is implemented as a Valve
so that it can be ommitted in environments that do not require these
features. Individual implementations of each supported authentication
method can subclass this base class as required.
USAGE CONSTRAINT: When this class is utilized, the Context to
which it is attached (or a parent Container in a hierarchy) must have an
associated Realm that can be used for authenticating users and enumerating
the roles to which they have been assigned.
USAGE CONSTRAINT: This Valve is only useful when processing HTTP
requests. Requests of any other type will simply be passed through.
author: Craig R. McClanahan version: $Revision: 1.32 $ $Date: 2002/06/09 02:19:41 $ |
Field Summary | |
final protected static String | DEFAULT_ALGORITHM The default message digest algorithm to use if we cannot use
the requested one. | final protected static int | SESSION_ID_BYTES The number of random bytes to include when generating a
session identifier. | protected String | algorithm The message digest algorithm to be used when generating session
identifiers. | protected boolean | cache | protected Context | context The Context to which this Valve is attached. | protected int | debug The debugging detail level for this component. | protected MessageDigest | digest Return the MessageDigest implementation to be used when
creating session identifiers. | protected String | entropy A String initialization parameter used to increase the entropy of
the initialization of our random number generator. | final protected static String | info Descriptive information about this implementation. | protected LifecycleSupport | lifecycle The lifecycle event support for this component. | protected Random | random A random number generator to use when generating session identifiers. | protected String | randomClass The Java class name of the random number generator class to be used
when generating session identifiers. | final protected static StringManager | sm The string manager for this package. | protected SingleSignOn | sso The SingleSignOn implementation in our request processing chain,
if there is one. | protected boolean | started |
Method Summary | |
protected boolean | accessControl(HttpRequest request, HttpResponse response, SecurityConstraint constraint) Perform access control based on the specified authorization constraint. | public void | addLifecycleListener(LifecycleListener listener) Add a lifecycle event listener to this component. | protected void | associate(String ssoId, Session session) Associate the specified single sign on identifier with the
specified Session. | abstract protected boolean | authenticate(HttpRequest request, HttpResponse response, LoginConfig config) Authenticate the user making this request, based on the specified
login configuration. | protected boolean | checkUserData(HttpRequest request, HttpResponse response, SecurityConstraint constraint) Enforce any user data constraint required by the security constraint
guarding this request URI. | protected SecurityConstraint | findConstraint(HttpRequest request) Return the SecurityConstraint configured to guard the request URI for
this request, or null if there is no such constraint. | public LifecycleListener[] | findLifecycleListeners() Get the lifecycle listeners associated with this lifecycle. | protected synchronized String | generateSessionId() Generate and return a new session identifier for the cookie that
identifies an SSO principal. | public String | getAlgorithm() Return the message digest algorithm for this Manager. | public boolean | getCache() Return the cache authenticated Principals flag. | public Container | getContainer() Return the Container to which this Valve is attached. | public int | getDebug() Return the debugging detail level for this component. | protected synchronized MessageDigest | getDigest() Return the MessageDigest object to be used for calculating
session identifiers. | public String | getEntropy() Return the entropy increaser value, or compute a semi-useful value
if this String has not yet been set. | public String | getInfo() Return descriptive information about this Valve implementation. | protected synchronized Random | getRandom() Return the random number generator instance we should use for
generating session identifiers. | public String | getRandomClass() Return the random number generator class name. | protected Session | getSession(HttpRequest request) Return the internal Session that is associated with this HttpRequest,
or null if there is no such Session. | protected Session | getSession(HttpRequest request, boolean create) Return the internal Session that is associated with this HttpRequest,
possibly creating a new one if necessary, or null if
there is no such session and we did not create one. | public void | invoke(Request request, Response response, ValveContext context) Enforce the security restrictions in the web application deployment
descriptor of our associated Context. | protected void | log(String message) Log a message on the Logger associated with our Container (if any). | protected void | log(String message, Throwable throwable) Log a message on the Logger associated with our Container (if any). | protected void | register(HttpRequest request, HttpResponse response, Principal principal, String authType, String username, String password) Register an authenticated Principal and authentication type in our
request, in the current session (if there is one), and with our
SingleSignOn valve, if there is one. | public void | removeLifecycleListener(LifecycleListener listener) Remove a lifecycle event listener from this component. | public void | setAlgorithm(String algorithm) Set the message digest algorithm for this Manager. | public void | setCache(boolean cache) Set the cache authenticated Principals flag. | public void | setContainer(Container container) Set the Container to which this Valve is attached. | public void | setDebug(int debug) Set the debugging detail level for this component. | public void | setEntropy(String entropy) Set the entropy increaser value. | public void | setRandomClass(String randomClass) Set the random number generator class name. | public void | start() Prepare for the beginning of active use of the public methods of this
component. | public void | stop() Gracefully terminate the active use of the public methods of this
component. |
DEFAULT_ALGORITHM | final protected static String DEFAULT_ALGORITHM(Code) | | The default message digest algorithm to use if we cannot use
the requested one.
|
SESSION_ID_BYTES | final protected static int SESSION_ID_BYTES(Code) | | The number of random bytes to include when generating a
session identifier.
|
algorithm | protected String algorithm(Code) | | The message digest algorithm to be used when generating session
identifiers. This must be an algorithm supported by the
java.security.MessageDigest class on your platform.
|
cache | protected boolean cache(Code) | | Should we cache authenticated Principals if the request is part of
an HTTP session?
|
context | protected Context context(Code) | | The Context to which this Valve is attached.
|
debug | protected int debug(Code) | | The debugging detail level for this component.
|
digest | protected MessageDigest digest(Code) | | Return the MessageDigest implementation to be used when
creating session identifiers.
|
entropy | protected String entropy(Code) | | A String initialization parameter used to increase the entropy of
the initialization of our random number generator.
|
info | final protected static String info(Code) | | Descriptive information about this implementation.
|
random | protected Random random(Code) | | A random number generator to use when generating session identifiers.
|
randomClass | protected String randomClass(Code) | | The Java class name of the random number generator class to be used
when generating session identifiers.
|
sso | protected SingleSignOn sso(Code) | | The SingleSignOn implementation in our request processing chain,
if there is one.
|
started | protected boolean started(Code) | | Has this component been started?
|
accessControl | protected boolean accessControl(HttpRequest request, HttpResponse response, SecurityConstraint constraint) throws IOException(Code) | | Perform access control based on the specified authorization constraint.
Return true if this constraint is satisfied and processing
should continue, or false otherwise.
Parameters: request - Request we are processing Parameters: response - Response we are creating Parameters: constraint - Security constraint we are enforcing exception: IOException - if an input/output error occurs |
addLifecycleListener | public void addLifecycleListener(LifecycleListener listener)(Code) | | Add a lifecycle event listener to this component.
Parameters: listener - The listener to add |
associate | protected void associate(String ssoId, Session session)(Code) | | Associate the specified single sign on identifier with the
specified Session.
Parameters: ssoId - Single sign on identifier Parameters: session - Session to be associated |
authenticate | abstract protected boolean authenticate(HttpRequest request, HttpResponse response, LoginConfig config) throws IOException(Code) | | Authenticate the user making this request, based on the specified
login configuration. Return true if any specified
constraint has been satisfied, or false if we have
created a response challenge already.
Parameters: request - Request we are processing Parameters: response - Response we are creating Parameters: login - Login configuration describing how authenticationshould be performed exception: IOException - if an input/output error occurs |
checkUserData | protected boolean checkUserData(HttpRequest request, HttpResponse response, SecurityConstraint constraint) throws IOException(Code) | | Enforce any user data constraint required by the security constraint
guarding this request URI. Return true if this constraint
was not violated and processing should continue, or false
if we have created a response already.
Parameters: request - Request we are processing Parameters: response - Response we are creating Parameters: constraint - Security constraint being checked exception: IOException - if an input/output error occurs |
findConstraint | protected SecurityConstraint findConstraint(HttpRequest request)(Code) | | Return the SecurityConstraint configured to guard the request URI for
this request, or null if there is no such constraint.
Parameters: request - Request we are processing |
findLifecycleListeners | public LifecycleListener[] findLifecycleListeners()(Code) | | Get the lifecycle listeners associated with this lifecycle. If this
Lifecycle has no listeners registered, a zero-length array is returned.
|
generateSessionId | protected synchronized String generateSessionId()(Code) | | Generate and return a new session identifier for the cookie that
identifies an SSO principal.
|
getAlgorithm | public String getAlgorithm()(Code) | | Return the message digest algorithm for this Manager.
|
getCache | public boolean getCache()(Code) | | Return the cache authenticated Principals flag.
|
getContainer | public Container getContainer()(Code) | | Return the Container to which this Valve is attached.
|
getDebug | public int getDebug()(Code) | | Return the debugging detail level for this component.
|
getDigest | protected synchronized MessageDigest getDigest()(Code) | | Return the MessageDigest object to be used for calculating
session identifiers. If none has been created yet, initialize
one the first time this method is called.
|
getEntropy | public String getEntropy()(Code) | | Return the entropy increaser value, or compute a semi-useful value
if this String has not yet been set.
|
getInfo | public String getInfo()(Code) | | Return descriptive information about this Valve implementation.
|
getRandom | protected synchronized Random getRandom()(Code) | | Return the random number generator instance we should use for
generating session identifiers. If there is no such generator
currently defined, construct and seed a new one.
|
getRandomClass | public String getRandomClass()(Code) | | Return the random number generator class name.
|
getSession | protected Session getSession(HttpRequest request)(Code) | | Return the internal Session that is associated with this HttpRequest,
or null if there is no such Session.
Parameters: request - The HttpRequest we are processing |
getSession | protected Session getSession(HttpRequest request, boolean create)(Code) | | Return the internal Session that is associated with this HttpRequest,
possibly creating a new one if necessary, or null if
there is no such session and we did not create one.
Parameters: request - The HttpRequest we are processing Parameters: create - Should we create a session if needed? |
invoke | public void invoke(Request request, Response response, ValveContext context) throws IOException, ServletException(Code) | | Enforce the security restrictions in the web application deployment
descriptor of our associated Context.
Parameters: request - Request to be processed Parameters: response - Response to be processed Parameters: context - The valve context used to invoke the next valvein the current processing pipeline exception: IOException - if an input/output error occurs exception: ServletException - if thrown by a processing element |
log | protected void log(String message)(Code) | | Log a message on the Logger associated with our Container (if any).
Parameters: message - Message to be logged |
log | protected void log(String message, Throwable throwable)(Code) | | Log a message on the Logger associated with our Container (if any).
Parameters: message - Message to be logged Parameters: throwable - Associated exception |
register | protected void register(HttpRequest request, HttpResponse response, Principal principal, String authType, String username, String password)(Code) | | Register an authenticated Principal and authentication type in our
request, in the current session (if there is one), and with our
SingleSignOn valve, if there is one. Set the appropriate cookie
to be returned.
Parameters: request - The servlet request we are processing Parameters: response - The servlet response we are generating Parameters: principal - The authenticated Principal to be registered Parameters: authType - The authentication type to be registered Parameters: username - Username used to authenticate (if any) Parameters: password - Password used to authenticate (if any) |
removeLifecycleListener | public void removeLifecycleListener(LifecycleListener listener)(Code) | | Remove a lifecycle event listener from this component.
Parameters: listener - The listener to remove |
setAlgorithm | public void setAlgorithm(String algorithm)(Code) | | Set the message digest algorithm for this Manager.
Parameters: algorithm - The new message digest algorithm |
setCache | public void setCache(boolean cache)(Code) | | Set the cache authenticated Principals flag.
Parameters: cache - The new cache flag |
setContainer | public void setContainer(Container container)(Code) | | Set the Container to which this Valve is attached.
Parameters: container - The container to which we are attached |
setDebug | public void setDebug(int debug)(Code) | | Set the debugging detail level for this component.
Parameters: debug - The new debugging detail level |
setEntropy | public void setEntropy(String entropy)(Code) | | Set the entropy increaser value.
Parameters: entropy - The new entropy increaser value |
setRandomClass | public void setRandomClass(String randomClass)(Code) | | Set the random number generator class name.
Parameters: randomClass - The new random number generator class name |
start | public void start() throws LifecycleException(Code) | | Prepare for the beginning of active use of the public methods of this
component. This method should be called after configure() ,
and before any of the public methods of the component are utilized.
exception: LifecycleException - if this component detects a fatal errorthat prevents this component from being used |
stop | public void stop() throws LifecycleException(Code) | | Gracefully terminate the active use of the public methods of this
component. This method should be the last one called on a given
instance of this component.
exception: LifecycleException - if this component detects a fatal errorthat needs to be reported |
|
|