| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.jcms.authentication.AuthenticationHandler
com.jalios.jcms.authentication.handlers.CookieAuthenticationHandler
public final class CookieAuthenticationHandler
Save authentification made by other handlers into cookie
 and use it later on to re-authenticate.
 
 You can disable this handler by modifiying property "auth-mgr.cookie-enabled".
 Cookie can be disabled for admin by modifiying property "auth-mgr.allow-admin-cookie".
| Field Summary | |
|---|---|
static String | 
AUTHENTICATION_COOKIE_NAME
Name of cookie used for authentication.  | 
static int | 
ORDER_COOKIE_HANDLER
Order used by the CookieAuthenticationHandler  | 
static String | 
REVISION
 | 
| Fields inherited from class com.jalios.jcms.authentication.AuthenticationHandler | 
|---|
channel, GENERIC_BAD_AUTHENTICATION_MSG | 
| Method Summary | |
|---|---|
static Member | 
checkAuthenticationFromCookie(javax.servlet.http.Cookie[] cookies)
Returns the member corresponding to the member id which is contains in memberId cookie.  | 
static javax.servlet.http.Cookie | 
getAuthenticationCookie(Member member,
                        String domain,
                        String path,
                        boolean isPersistent)
Returns a cookie for a given member  | 
static String | 
getCookieDigest(String timeStr,
                String password)
Returns the cookie digest (MD5) composed of concatenation of the time (in millis) and the password of the member  | 
static javax.servlet.http.Cookie | 
getEmptyAuthenticationCookie(String domain,
                             String path)
Returns an empty authentication cookie (used for logout)  | 
static CookieAuthenticationHandler | 
getInstance()
 | 
 void | 
loadProperties()
This method will be called by the AuthenticationManager each time the Channel properties are loaded/reloaded.  | 
 void | 
login(AuthenticationContext ctxt)
Authenticate a member.  | 
 void | 
logout(AuthenticationContext ctxt)
This methods is called when users logout from JCMS.  | 
| Methods inherited from class com.jalios.jcms.authentication.AuthenticationHandler | 
|---|
compareTo, equals, getOrder, init, setOrder | 
| Methods inherited from class java.lang.Object | 
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String REVISION
public static final int ORDER_COOKIE_HANDLER
public static final String AUTHENTICATION_COOKIE_NAME
| Method Detail | 
|---|
public static final CookieAuthenticationHandler getInstance()
public void loadProperties()
AuthenticationHandler
loadProperties in class AuthenticationHandler
public void login(AuthenticationContext ctxt)
           throws IOException
AuthenticationHandlerAuthenticationContext object (request, response, login.. etc) AuthenticationContext.setLoggedMember(com.jalios.jcms.Member)AuthenticationContext.doChain(),AuthenticationContext.
login in class AuthenticationHandlerctxt - the AuthenticationContext used for this login
IOException
public void logout(AuthenticationContext ctxt)
            throws IOException
AuthenticationHandler
logout in class AuthenticationHandlerctxt - the AuthenticationContext used for this login
IOException
public static final String getCookieDigest(String timeStr,
                                           String password)
timeStr - a time as a string (e.g. String.valueOf(System.currentTimeMillis()))password - the Member's password in its crypted version (e.g. member.getPassword())
public static final Member checkAuthenticationFromCookie(javax.servlet.http.Cookie[] cookies)
cookies - an array of cookies (request.getCookies())
public static final javax.servlet.http.Cookie getAuthenticationCookie(Member member,
                                                                      String domain,
                                                                      String path,
                                                                      boolean isPersistent)
                                                               throws UnknownHostException
member - the member to use to generate the cookie.domain - an optionnal String containing the domain name within which the cookie is visible; form is according to RFC 2109path - the cookie pathisPersistent - if true the cookie will persist on the user disk beyond the
        browser shutdown ; otherwise it will persist until browser shutdown.
UnknownHostException - if the specified domain could not be resolved
public static final javax.servlet.http.Cookie getEmptyAuthenticationCookie(String domain,
                                                                           String path)
                                                                    throws UnknownHostException
domain - the cookie domain (can be null)path - the cookie path
UnknownHostException - if the specified domain could not be resolved
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||