org.norther.tammi.spray.authenticator
Class DefaultHttpDigestAuthFilter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.spray.filter.DefaultFilter
          extended by org.norther.tammi.spray.authenticator.AbstractAuthenticatorFilter
              extended by org.norther.tammi.spray.authenticator.DefaultHttpDigestAuthFilter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Manageable, MBeanDelegate, AuthenticatorFilter, HttpDigestAuthFilter

public class DefaultHttpDigestAuthFilter
extends AbstractAuthenticatorFilter
implements HttpDigestAuthFilter

An implementation of the DIGEST authentication sheme.

Based on DigestAuthenticator in the Apache Jakarta Tomcat project.

Author:
Craig R. McClanahan, Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.spray.authenticator.AbstractAuthenticatorFilter
DEFAULT_USER_ACCOUNT_ID_ATTIBUTE
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.spray.authenticator.HttpDigestAuthFilter
DIGEST_AUTH
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
DefaultHttpDigestAuthFilter()
          Constructs a new filter.
 
Method Summary
 Principal authenticate(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
          Authenticates a request within the realm of this filter.
 String getAuthType()
          Gets the authentication scheme.
 int getDigestTimeout()
          Gets the digest timeout.
 void setDigestTimeout(int timeout)
          Sets the digest timeout.
 void setPrivateKey(String key)
          Sets the private key.
 void unauthenticated(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
          A handler for unauthenticated requests that should provide an opportunity for the user to re-authenticate himself.
 
Methods inherited from class org.norther.tammi.spray.authenticator.AbstractAuthenticatorFilter
decrementLoginAttempts, doFilter, generateAuthenticate, getAuthenticationURL, getCredentials, getDefaultDomain, getFaultyUser, getLoginAttempts, getLoginAttempts, getLogoutFlow, getLogoutHost, getLogoutPipe, getLogoutService, getLogoutTemplate, getLogoutURI, getLogoutURL, getPublicRealmName, getRealm, getRealmName, getUnauthorizedTemplate, incrementLoginAttempts, isAuthenticationRequired, isAutoLoginEnabled, isCachedPrincipalDiscarded, isUserInRole, postmanaged, setAuthenticationRequired, setAutoLoginEnabled, setCachedPrincipalDiscarded, setDefaultDomain, setFaultyUser, setLoginAttempts, setLogoutFlow, setLogoutHost, setLogoutPipe, setLogoutService, setLogoutTemplate, setLogoutURI, setPublicRealmName, setRealmName, setUnauthorizedTemplate, unmanaged, verifyAuthentication
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter
destroy, getFilterConfig, getRequestMap, getSessionMap, init
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.spray.authenticator.AuthenticatorFilter
getDefaultDomain, getFaultyUser, getLoginAttempts, getLoginAttempts, getLogoutFlow, getLogoutHost, getLogoutPipe, getLogoutService, getLogoutTemplate, getLogoutURI, getLogoutURL, getPublicRealmName, getRealmName, getUnauthorizedTemplate, isAuthenticationRequired, isAutoLoginEnabled, isCachedPrincipalDiscarded, isUserInRole, setAuthenticationRequired, setAutoLoginEnabled, setCachedPrincipalDiscarded, setDefaultDomain, setLoginAttempts, setLogoutFlow, setLogoutHost, setLogoutPipe, setLogoutService, setLogoutTemplate, setLogoutURI, setPublicRealmName, setRealmName, setUnauthorizedTemplate
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Constructor Detail

DefaultHttpDigestAuthFilter

public DefaultHttpDigestAuthFilter()
Constructs a new filter.

Method Detail

getAuthType

public String getAuthType()
Description copied from interface: AuthenticatorFilter
Gets the authentication scheme.

Specified by:
getAuthType in interface AuthenticatorFilter
Specified by:
getAuthType in class AbstractAuthenticatorFilter
Returns:
the authentication scheme.

setPrivateKey

public void setPrivateKey(String key)
Description copied from interface: HttpDigestAuthFilter
Sets the private key.

Specified by:
setPrivateKey in interface HttpDigestAuthFilter
Parameters:
key - the private key.

getDigestTimeout

public int getDigestTimeout()
Description copied from interface: HttpDigestAuthFilter
Gets the digest timeout.

Specified by:
getDigestTimeout in interface HttpDigestAuthFilter
Returns:
the digest timeout in secs, -1 = forever.

setDigestTimeout

public void setDigestTimeout(int timeout)
Description copied from interface: HttpDigestAuthFilter
Sets the digest timeout.

Specified by:
setDigestTimeout in interface HttpDigestAuthFilter
Parameters:
timeout - the digest timeout in secs, -1 = forever.

authenticate

public Principal authenticate(HttpServletRequest request,
                              HttpServletResponse response,
                              FilterChain chain)
Description copied from interface: AuthenticatorFilter
Authenticates a request within the realm of this filter.

Specified by:
authenticate in interface AuthenticatorFilter
Specified by:
authenticate in class AbstractAuthenticatorFilter
Parameters:
request - the request.
response - the response.
chain - the filter chain.
Returns:
the authenticated user principal or null.

unauthenticated

public void unauthenticated(HttpServletRequest request,
                            HttpServletResponse response,
                            FilterChain chain)
                     throws ServletException,
                            IOException
Description copied from interface: AuthenticatorFilter
A handler for unauthenticated requests that should provide an opportunity for the user to re-authenticate himself. Must either produce a valid response or throw an exception.

Specified by:
unauthenticated in interface AuthenticatorFilter
Overrides:
unauthenticated in class AbstractAuthenticatorFilter
Parameters:
request - the request.
response - the response.
chain - the filter chain.
Throws:
ServletException - for servlet errors.
IOException - for general errors.


Copyright © 2004 The Norther Organization. All rights reserved.