org.jboss.web.tomcat.security
Class WebCallbackHandler

java.lang.Object
  extended byorg.jboss.security.auth.callback.SecurityAssociationHandler (src) 
      extended byorg.jboss.web.tomcat.security.WebCallbackHandler
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler

public class WebCallbackHandler
extends SecurityAssociationHandler (src)
implements javax.security.auth.callback.CallbackHandler

An implementation of CallbackHandler that extends the default SecurityAssociationHandler to add Callbacks that only have sense in a Web environment. In order to use it you need to override the default CallbackHandler used by the JaasSecurityManager.

See Also:
CallbackHandler, handle(Callback[])

Constructor Summary
WebCallbackHandler()
           
WebCallbackHandler(java.security.Principal principal, java.lang.Object credential)
          Initialize the HttpServletRequestCallbackHandler with the principal and credentials to use.
 
Method Summary
protected  HttpServletRequest getHttpServletRequestFromValve()
          Obtains the HttpServletRequest saved inside the HttpServletRequestValve.
 void handle(javax.security.auth.callback.Callback[] callbacks)
          Handles SecurityAssociationCallback, ObjectCallback, NameCallback and PasswordCallback types.
 void setSecurityInfo(java.security.Principal principal, java.lang.Object credential)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebCallbackHandler

public WebCallbackHandler()

WebCallbackHandler

public WebCallbackHandler(java.security.Principal principal,
                          java.lang.Object credential)
Initialize the HttpServletRequestCallbackHandler with the principal and credentials to use.

Method Detail

setSecurityInfo

public void setSecurityInfo(java.security.Principal principal,
                            java.lang.Object credential)
Overrides:
setSecurityInfo in class SecurityAssociationHandler (src)
See Also:
SecurityAssociationHandler.setSecurityInfo(java.security.Principal, java.lang.Object)

handle

public void handle(javax.security.auth.callback.Callback[] callbacks)
            throws javax.security.auth.callback.UnsupportedCallbackException
Description copied from class: SecurityAssociationHandler (src)
Handles SecurityAssociationCallback, ObjectCallback, NameCallback and PasswordCallback types. A NameCallback name property is set to the Prinicpal.getName() value. A PasswordCallback password property is set to the getPassword() value. The preferred SecurityAssociationCallback has its principal and credential properties set to the instance principal and credential. An ObjectCallback has its credential set to the credential value.

Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Overrides:
handle in class SecurityAssociationHandler (src)
Throws:
javax.security.auth.callback.UnsupportedCallbackException
See Also:
CallbackHandler.handle(javax.security.auth.callback.Callback[])

getHttpServletRequestFromValve

protected HttpServletRequest getHttpServletRequestFromValve()
Obtains the HttpServletRequest saved inside the HttpServletRequestValve.

Returns:
an HttpServletRequest.