org.apache.tomcat.modules.aaa
Class CredentialsInterceptor

java.lang.Object
  extended byorg.apache.tomcat.core.BaseInterceptor
      extended byorg.apache.tomcat.modules.aaa.CredentialsInterceptor

public class CredentialsInterceptor
extends BaseInterceptor

Extract user/password credentials from a request. This module is specialized in detecting BASIC and FORM authentication, and will set 2 notes in the request: "credentials.user" and "credentials.password". A "Realm" module may use the 2 notes in authenticating the user. This module must will act on the "authenticate" callback - the action will happen _only_ for requests requiring authentication, not for every request. It must be configured before the Realm module.


Field Summary
static java.lang.String PASSWORD_NOTE
          The module will set a note with this name on the request for the extracted password, if Basic or Form authentication is used
static java.lang.String USER_NOTE
          The module will set a note with this name on the request for the extracted user, if Basic or Form authentication is used
 
Fields inherited from class org.apache.tomcat.core.BaseInterceptor
cm, ct, ctx, debug, DECLINED, loghelper, OK
 
Constructor Summary
CredentialsInterceptor()
           
 
Method Summary
 int authenticate(Request req, Response res)
          Extract the credentails from req
 void engineInit(ContextManager cm)
          Initialize the module.
 
Methods inherited from class org.apache.tomcat.core.BaseInterceptor
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authorize, beforeBody, beforeCommit, contextInit, contextMap, contextShutdown, contextState, copyContext, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_NOTE

public static final java.lang.String USER_NOTE
The module will set a note with this name on the request for the extracted user, if Basic or Form authentication is used

See Also:
Constant Field Values

PASSWORD_NOTE

public static final java.lang.String PASSWORD_NOTE
The module will set a note with this name on the request for the extracted password, if Basic or Form authentication is used

See Also:
Constant Field Values
Constructor Detail

CredentialsInterceptor

public CredentialsInterceptor()
Method Detail

engineInit

public void engineInit(ContextManager cm)
                throws TomcatException
Description copied from class: BaseInterceptor
Initialize the module.

Overrides:
engineInit in class BaseInterceptor
Throws:
TomcatException - The module will not be added if any exception is thrown by engineInit.

authenticate

public int authenticate(Request req,
                        Response res)
Extract the credentails from req

Overrides:
authenticate in class BaseInterceptor


Copyright ? 2001 Apache Software Foundation. All Rights Reserved.