public abstract class AuthenticationHandler extends java.lang.Object implements java.lang.Comparable<AuthenticationHandler>, PluginComponent
loadProperties()
method can be overridden to load/reload properties as needed.Modifier and Type | Field and Description |
---|---|
protected static Channel |
channel |
static java.lang.String |
GENERIC_BAD_AUTHENTICATION_MSG
Use this constant with
AuthenticationContext.setWarningMsg(String)
to provide a generic authentication failure message. |
static java.lang.String |
REVISION |
Constructor and Description |
---|
AuthenticationHandler()
Creates a new AuthenticationHandler.
The default order of this new handler is 0. |
AuthenticationHandler(int order)
Constructs a AuthenticationHandler with the specified order.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canLogout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.util.Locale userLocale,
Member loggedMember,
boolean isAuthorized)
This methods is invoked on all
AuthenticationHandler , BEFORE a logout action, to check security context authorize the logout chain to be invoked. |
int |
compareTo(AuthenticationHandler authHdlr)
Compare this object with the specified AuthenticationHandler for order.
|
boolean |
equals(java.lang.Object obj)
Indicates wheter some other object is "equal to" this one.
|
int |
getOrder()
Retrieve the order used by this AuthenticationHandler.
|
boolean |
init(Plugin plugin)
Initialize the component with the given plugin configuration
|
void |
loadProperties()
This 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 |
void |
login(AuthenticationContext ctxt)
Authenticate a member.
|
void |
logout(AuthenticationContext ctxt)
This methods is called when users logout from JCMS.
|
void |
setOrder(int order)
Modify the order used by this AuthenticationHandler.
|
public static final java.lang.String REVISION
public static final java.lang.String GENERIC_BAD_AUTHENTICATION_MSG
AuthenticationContext.setWarningMsg(String)
to provide a generic authentication failure message.protected static final Channel channel
public AuthenticationHandler()
public AuthenticationHandler(int order)
order
- an integer used by the natural comparator of this AuthenticationHandler
to sort all AuthenticationHandler managed by the AuthenticationManager
.public void loadProperties()
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling pluginpublic void login(AuthenticationContext ctxt) throws java.io.IOException
AuthenticationContext
object (request, response, login.. etc) AuthenticationContext.setLoggedMember(com.jalios.jcms.Member)
AuthenticationContext.doChain()
,AuthenticationContext
.ctxt
- the AuthenticationContext
used for this loginjava.io.IOException
public boolean canLogout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.util.Locale userLocale, Member loggedMember, boolean isAuthorized)
AuthenticationHandler
, BEFORE a logout action, to check security context authorize the logout chain to be invoked.
Core implementation is to authorize logout only when a valid CSRF token was received (since JCMS-8092).
Each AuthenticationHandler SSO may authorize logout under additionnal circumstances by implementing this method.
Default implementation is to return the samed isAuthorized value received in parameter.
request
- the current HttpServletRequest being processedresponse
- the HttpServletResponse bound to current requestuserLocale
- the current Locale guessed from browser preference or sessionloggedMember
- the member currently logged inisAuthorized
- true if logout has been authorized by default JCMS behavior or by any other AuthenticationHandler, false otherwisepublic void logout(AuthenticationContext ctxt) throws java.io.IOException
ctxt
- the AuthenticationContext
used for this loginjava.io.IOException
public final int compareTo(AuthenticationHandler authHdlr)
compareTo
in interface java.lang.Comparable<AuthenticationHandler>
authHdlr
- the AuthenticationHandler to be compared.Comparable.compareTo(java.lang.Object)
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the Object to be compared.public int getOrder()
public void setOrder(int order)
order
- the new order to use for this AuthenticationHandlerCopyright © 2001-2021 Jalios SA. All Rights Reserved.