@Prototype public class EvaluateDelegationPolicy extends AbstractProfileAction
Assertion token is allowed to proceed.
Two policy checks are performed:
SSOSProfileConfiguration is resolved and the predicate
SSOSProfileConfiguration.getDelegationPredicate() is applied. If the predicate evaluates to false,
the request is not allowed. An example predicate commonly used here is
AllowedSAMLPresentersPredicate.
DelegationRestrictionType
condition is evaluated against a policy maximum resolved via the strategy set by
setPolicyMaxChainLengthStrategy(Function), or from DEFAULT_POLICY_MAX_CHAIN_LENGTH if no value
can otherwise be resolved. If the chain of Delegate
child elements is greater than or equal to the resolved policy max chain length, the request is not allowed.
The default policy resolution strategy is to look at the first DelegationPolicy contained within the
inbound assertion token's Advice.
| Modifier and Type | Class and Description |
|---|---|
class |
EvaluateDelegationPolicy.PolicyMaxChainLengthStrategy
Default strategy used to resolve the policy maximum token delegation chain length.
|
| Modifier and Type | Field and Description |
|---|---|
private Assertion |
assertionToken
The inbound delegated assertion token being evaluated.
|
private com.google.common.base.Function<ProfileRequestContext,Assertion> |
assertionTokenStrategy
Function used to resolve the assertion token to process.
|
static Long |
DEFAULT_POLICY_MAX_CHAIN_LENGTH
Default policy max chain length, when can't otherwise be derived.
|
private com.google.common.base.Predicate<ProfileRequestContext> |
delegationPredicate
The predicate used to determine whether the request is allowed to proceed.
|
private org.slf4j.Logger |
log
Logger.
|
private Long |
policyMaxChainLength
The policy maximum token delegation chain length.
|
private com.google.common.base.Function<ProfileRequestContext,Long> |
policyMaxChainLengthStrategy
Function used to resolve the policy maximum delegation chain length.
|
private com.google.common.base.Function<ProfileRequestContext,RelyingPartyContext> |
relyingPartyContextLookupStrategy
Strategy used to lookup the RelyingPartyContext.
|
private Long |
tokenChainLength
The actual token delegation chain length.
|
| Constructor and Description |
|---|
EvaluateDelegationPolicy()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkAllowedDelegate(ProfileRequestContext profileRequestContext)
Apply policy control
SSOSProfileConfiguration.getDelegationPredicate(). |
protected boolean |
checkTokenDelegationChainLength(ProfileRequestContext profileRequestContext)
Apply policy control which checks the actual token chain length against
the policy maximum chain length.
|
protected void |
doExecute(ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecuteInbound(ProfileRequestContext profileRequestContext)
Pre-execute actions on the inbound message.
|
protected boolean |
doPreExecuteRelyingParty(ProfileRequestContext profileRequestContext)
Pre-execute actions on the relying party context info.
|
protected DelegationRestrictionType |
getDelegationRestrictionCondition(Conditions conditions)
Get the DelegationRestrictionType Condition from the supplied Conditions, if present.
|
protected Long |
getPolicyMaxDelegationChainLength(ProfileRequestContext profileRequestContext)
Get the effective maximum delegation chain length allowed by policy.
|
protected Long |
getTokenDelegationChainLength(Assertion token)
Get the length of the delegation chain in the presented token.
|
void |
setAssertionTokenStrategy(com.google.common.base.Function<ProfileRequestContext,Assertion> strategy)
Set the strategy used to locate the inbound assertion token to process.
|
void |
setPolicyMaxChainLengthStrategy(com.google.common.base.Function<ProfileRequestContext,Long> strategy)
Set the strategy used to resolve the policy maximum delegation chain length.
|
void |
setRelyingPartyContextLookupStrategy(com.google.common.base.Function<ProfileRequestContext,RelyingPartyContext> strategy)
Set the strategy used to locate the current
RelyingPartyContext. |
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitializedpublic static final Long DEFAULT_POLICY_MAX_CHAIN_LENGTH
private org.slf4j.Logger log
@Nonnull private com.google.common.base.Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
@Nonnull private com.google.common.base.Function<ProfileRequestContext,Assertion> assertionTokenStrategy
@Nonnull private com.google.common.base.Function<ProfileRequestContext,Long> policyMaxChainLengthStrategy
private Assertion assertionToken
private Long policyMaxChainLength
private Long tokenChainLength
private com.google.common.base.Predicate<ProfileRequestContext> delegationPredicate
public void setPolicyMaxChainLengthStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,Long> strategy)
strategy - the strategypublic void setAssertionTokenStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,Assertion> strategy)
strategy - lookup strategypublic void setRelyingPartyContextLookupStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,RelyingPartyContext> strategy)
RelyingPartyContext.strategy - strategy used to locate the current RelyingPartyContextprotected boolean doPreExecute(ProfileRequestContext profileRequestContext)
doPreExecute in class AbstractConditionalProfileActionprotected boolean doPreExecuteInbound(@Nonnull ProfileRequestContext profileRequestContext)
profileRequestContext - the current profile request contextdoExecute(ProfileRequestContext) should proceedprotected boolean doPreExecuteRelyingParty(@Nonnull ProfileRequestContext profileRequestContext)
profileRequestContext - the current profile request contextdoExecute(ProfileRequestContext) should proceedprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
doExecute in class AbstractProfileActionprotected boolean checkAllowedDelegate(@Nonnull ProfileRequestContext profileRequestContext)
SSOSProfileConfiguration.getDelegationPredicate().profileRequestContext - the current request contextprotected boolean checkTokenDelegationChainLength(@Nonnull ProfileRequestContext profileRequestContext)
profileRequestContext - the current request contextprotected Long getTokenDelegationChainLength(@Nonnull Assertion token)
token - the token to evaluateprotected DelegationRestrictionType getDelegationRestrictionCondition(@Nullable Conditions conditions)
conditions - the Assertion Conditions to process@Nonnull protected Long getPolicyMaxDelegationChainLength(@Nonnull ProfileRequestContext profileRequestContext)
profileRequestContext - the current request contextCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.