public class DelegationAuthenticationHandler extends AuthenticationHandler
Any account can be excluded from delegation by adding its member's ID to the
property (seperated with space or coma) :
auth-mgr.delegation.excluded-mbr-ids: c_42
Modifier and Type | Field and Description |
---|---|
static int |
ORDER_DELEGATION_HANDLER
Order used by the DelegationAuthenticationHandler
|
static java.lang.String |
PROP_ENABLED
Property key used to read if delegation is enabled or not
|
static java.lang.String |
PROP_EXCLUDED_MBR_IDS
Property key used to read the member ids which are excluded from delegation
|
static java.lang.String |
PROP_REQUIRES_CSRF_TOKEN
Property key used to read boolean setting indicating if CSRF token is required to delegate into another member
|
channel, GENERIC_BAD_AUTHENTICATION_MSG, REVISION
Modifier and Type | Method and Description |
---|---|
boolean |
canDelegateTo(Member loggedMember,
Member targetMbr,
javax.servlet.http.HttpServletRequest request)
Check if the logged Member is allowed to delegate to the specified target Member.
|
java.util.Set<Member> |
filterExcludedMember(java.util.Set<Member> setToFilter)
Deprecated.
since jcms-10.0.3, use
getDelegationHolderSet(Member) if you want to retrieve logged member's possible delegation, or canDelegateTo(Member, Member, HttpServletRequest) to check if delegation is authorized as it performs all verifications |
java.util.Set<Member> |
getDelegationHolderSet(Member mbr)
Retrieves the list of member into which this member is allowed to log in.
|
static DelegationAuthenticationHandler |
getInstance() |
static java.util.List<Member> |
getSuHistory(javax.servlet.http.HttpServletRequest request)
Retrieve the change user history from the current session.
|
static java.lang.String |
getSuLink(Member suMember)
Retrieves a link that will request an user changer to the specified member.
Note : The link is always return, even though the su might not be allowed. |
boolean |
isEnabled()
Check if delegation is enabled on this site.
|
boolean |
isExcludedFromDelegation(Member suMbr)
Deprecated.
since jcms-10.0.3, use
canDelegateTo(Member, Member, HttpServletRequest) which performs all verifications |
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.
|
public static final int ORDER_DELEGATION_HANDLER
public static final java.lang.String PROP_ENABLED
public static final java.lang.String PROP_EXCLUDED_MBR_IDS
public static final java.lang.String PROP_REQUIRES_CSRF_TOKEN
public static final DelegationAuthenticationHandler getInstance()
public void loadProperties()
AuthenticationHandler
loadProperties
in class AuthenticationHandler
public void login(AuthenticationContext ctxt) throws java.io.IOException
AuthenticationHandler
AuthenticationContext
object (request, response, login.. etc) AuthenticationContext.setLoggedMember(com.jalios.jcms.Member)
AuthenticationContext.doChain()
,AuthenticationContext
.login
in class AuthenticationHandler
ctxt
- the AuthenticationContext
used for this loginjava.io.IOException
public boolean isEnabled()
public boolean canDelegateTo(Member loggedMember, Member targetMbr, javax.servlet.http.HttpServletRequest request)
This method verify all known restrictions and authorizations related to delegation.
Current implementation includes the following rules.
PROP_EXCLUDED_MBR_IDS
loggedMember
- the member currently logged for which verification is performedtargetMbr
- the Member in which delegation is requestedrequest
- the current servlet request, may be null, but required to allow "log back"public java.util.Set<Member> getDelegationHolderSet(Member mbr)
This method filters any unauthorized member (such as contact, disabled Member, or Member
which have been excluded from delegation
using property "auth-mgr.delegation.excluded-mbr-ids"
).
public java.util.Set<Member> filterExcludedMember(java.util.Set<Member> setToFilter)
getDelegationHolderSet(Member)
if you want to retrieve logged member's possible delegation, or canDelegateTo(Member, Member, HttpServletRequest)
to check if delegation is authorized as it performs all verificationssetToFilter
- the Member set to filter (this collection is NOT modified)isExcludedFromDelegation(Member)
public boolean isExcludedFromDelegation(Member suMbr)
canDelegateTo(Member, Member, HttpServletRequest)
which performs all verificationsA member can be a target of a delegation if the following condition are met :
PROP_EXCLUDED_MBR_IDS
suMbr
- the Member in which a delegation could be requestpublic static final java.util.List<Member> getSuHistory(javax.servlet.http.HttpServletRequest request)
request
- the current HttpServletRequestpublic static final java.lang.String getSuLink(Member suMember)
suMember
- the member to login into"index.jsp?JCMS_sulogin=johndoe"
)Copyright © 2001-2019 Jalios SA. All Rights Reserved.