Class LoggingAuthenticationHandler
- java.lang.Object
-
- com.jalios.jcms.authentication.AuthenticationHandler
-
- com.jalios.jcms.authentication.handlers.LoggingAuthenticationHandler
-
- All Implemented Interfaces:
PluginComponent
,java.lang.Comparable<AuthenticationHandler>
public final class LoggingAuthenticationHandler extends AuthenticationHandler
Provide logging of the authentication process using log4j.
This authentication handler must be the first in the list of authentication handlers to be able to log authentication made by other handlers.- Since:
- jcms-5.7.0
- Author:
- Olivier Jaquemet
-
-
Field Summary
Fields Modifier and Type Field Description static int
ORDER_LOGGING_HANDLER
Order used by the LoggingAuthenticationHandler-
Fields inherited from class com.jalios.jcms.authentication.AuthenticationHandler
channel, GENERIC_BAD_AUTHENTICATION_MSG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static LoggingAuthenticationHandler
getInstance()
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
canLogout, compareTo, equals, getOrder, init, loadProperties, setOrder
-
-
-
-
Field Detail
-
ORDER_LOGGING_HANDLER
public static final int ORDER_LOGGING_HANDLER
Order used by the LoggingAuthenticationHandler- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static final LoggingAuthenticationHandler getInstance()
-
login
public void login(AuthenticationContext ctxt) throws java.io.IOException
Description copied from class:AuthenticationHandler
Authenticate a member.
This method is invoked by the authentication chain on each request.
A typical implementation of this method would follow the following pattern :- Examine informations required to perform the authentication through
the
AuthenticationContext
object (request, response, login.. etc) - Perform your authentication before chain invokation and set the logged Member
AuthenticationContext.setLoggedMember(com.jalios.jcms.Member)
- a) Either invoke the next entity in the chain using
AuthenticationContext.doChain()
, - b) or else skip the chain invokation and block other authentication handler of the chain (do this with caution...)
- Perform redirection, set information/warning/error message or any
other process, after chain invokation, using
AuthenticationContext
.
Default implementation is to invoke the next handler in the chain.- Overrides:
login
in classAuthenticationHandler
- Parameters:
ctxt
- theAuthenticationContext
used for this login- Throws:
java.io.IOException
- Examine informations required to perform the authentication through
the
-
logout
public void logout(AuthenticationContext ctxt) throws java.io.IOException
Description copied from class:AuthenticationHandler
This methods is called when users logout from JCMS.
It may not be called if user simply close its browser. Don't rely on this for critical operation
Default implementation is to invoke the next handler in the chain.- Overrides:
logout
in classAuthenticationHandler
- Parameters:
ctxt
- theAuthenticationContext
used for this login- Throws:
java.io.IOException
-
-