Class SessionAuthenticationHandler
java.lang.Object
com.jalios.jcms.authentication.AuthenticationHandler
com.jalios.jcms.authentication.handlers.SessionAuthenticationHandler
- All Implemented Interfaces:
PluginComponent,Comparable<AuthenticationHandler>
Save authentification made by other handlers into session
and use it later on to re-authenticate.
- Since:
- jcms-5.7.0
- Author:
- Olivier Jaquemet
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOrder used by the SessionAuthenticationHandlerFields inherited from class com.jalios.jcms.authentication.AuthenticationHandler
channel, GENERIC_BAD_AUTHENTICATION_MSG -
Method Summary
Modifier and TypeMethodDescriptionstatic final MembercheckAuthenticationFromSession(javax.servlet.http.HttpServletRequest request) Returns the member corresponding to the information specified in the session.static final SessionAuthenticationHandlervoidThis method will be called by the AuthenticationManager each time the Channel properties are loaded/reloaded.
You can use it to reload properties that might have been changed.
This method is called during initialization of the AuthenticationManagervoidlogin(AuthenticationContext ctxt) Authenticate a member.static final voidstoreSessionAuthentication(javax.servlet.http.HttpServletRequest request, Member loggedMember) Store the given logged Member into the session for future authentication.
-
Field Details
-
ORDER_SESSION_HANDLER
public static final int ORDER_SESSION_HANDLEROrder used by the SessionAuthenticationHandler- See Also:
-
-
Method Details
-
getInstance
-
loadProperties
public void loadProperties()Description copied from class:AuthenticationHandlerThis method will be called by the AuthenticationManager each time the Channel properties are loaded/reloaded.
You can use it to reload properties that might have been changed.
This method is called during initialization of the AuthenticationManager- Overrides:
loadPropertiesin classAuthenticationHandler
-
login
Description copied from class:AuthenticationHandlerAuthenticate 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
AuthenticationContextobject (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:
loginin classAuthenticationHandler- Parameters:
ctxt- theAuthenticationContextused for this login- Throws:
IOException
- Examine informations required to perform the authentication through
the
-
checkAuthenticationFromSession
public static final Member checkAuthenticationFromSession(javax.servlet.http.HttpServletRequest request) Returns the member corresponding to the information specified in the session. ("loggedMemberId" attribute).- Parameters:
request- the request where to look for silent params- Returns:
- the authenticated member or null if not found
- Since:
- jcms-5.7.0
-
storeSessionAuthentication
public static final void storeSessionAuthentication(javax.servlet.http.HttpServletRequest request, Member loggedMember) Store the given logged Member into the session for future authentication.- Parameters:
request- the current HttpServletRequestloggedMember- the Member newly logged in- Since:
- jcms-5.7.0
-