com.caucho.security
Class AbstractCookieAuthenticator

java.lang.Object
  extended by com.caucho.security.AbstractAuthenticator
      extended by com.caucho.security.AbstractCookieAuthenticator
All Implemented Interfaces:
HandleAware, Authenticator, CookieAuthenticator, java.io.Serializable
Direct Known Subclasses:
DatabaseAuthenticator

public class AbstractCookieAuthenticator
extends AbstractAuthenticator
implements CookieAuthenticator

All applications should extend AbstractAuthenticator to implement their custom authenticators. While this isn't absolutely required, it protects implementations from API changes.

The AbstractAuthenticator provides a single-signon cache. Users logged into one web-app will share the same principal.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.caucho.security.AbstractAuthenticator
_passwordDigest, _passwordDigestAlgorithm, _passwordDigestRealm, NULL_USER
 
Constructor Summary
AbstractCookieAuthenticator()
           
 
Method Summary
 boolean associateCookie(java.security.Principal user, java.lang.String cookieValue)
          Associate the user with a cookie
 java.security.Principal authenticateByCookie(java.lang.String cookieValue)
          Authenticates the user based on the cookie
 boolean isCookieSupported(java.lang.String jUseCookieAuth)
          Test if cookie-based authentication is supported.
 
Methods inherited from class com.caucho.security.AbstractAuthenticator
addRoleMapping, authenticate, authenticate, authenticate, authenticate, authenticate, digest, getAlgorithm, getDigest, getDigestSecret, getDigestSecret, getLogoutOnSessionTimeout, getPasswordDigest, getPasswordDigest, getPasswordDigestAlgorithm, getPasswordDigestRealm, getPasswordUser, getPasswordUser, getSingleSignon, init, isUserInRole, logout, setLogoutOnSessionTimeout, setPasswordDigest, setPasswordDigestAlgorithm, setPasswordDigestRealm, setSerializationHandle, stringToDigest, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.security.Authenticator
authenticate, getAlgorithm, isUserInRole, logout
 

Constructor Detail

AbstractCookieAuthenticator

public AbstractCookieAuthenticator()
Method Detail

isCookieSupported

public boolean isCookieSupported(java.lang.String jUseCookieAuth)
Test if cookie-based authentication is supported.

Specified by:
isCookieSupported in interface CookieAuthenticator

associateCookie

public boolean associateCookie(java.security.Principal user,
                               java.lang.String cookieValue)
Associate the user with a cookie

Specified by:
associateCookie in interface CookieAuthenticator

authenticateByCookie

public java.security.Principal authenticateByCookie(java.lang.String cookieValue)
Authenticates the user based on the cookie

Specified by:
authenticateByCookie in interface CookieAuthenticator