@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.
AuthnEventIds.NO_CREDENTIALS, EventIds.INVALID_PROFILE_CTX, EventIds.INVALID_SEC_CFG| 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 org.opensaml.saml.saml2.core.Assertion |
assertionToken
The inbound delegated assertion token being evaluated.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.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 Predicate<org.opensaml.profile.context.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 Function<org.opensaml.profile.context.ProfileRequestContext,Long> |
policyMaxChainLengthStrategy
Function used to resolve the policy maximum delegation chain length.
|
private Function<org.opensaml.profile.context.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(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Apply policy control
SSOSProfileConfiguration.getDelegationPredicate(). |
protected boolean |
checkTokenDelegationChainLength(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Apply policy control which checks the actual token chain length against
the policy maximum chain length.
|
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecuteInbound(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Pre-execute actions on the inbound message.
|
protected boolean |
doPreExecuteRelyingParty(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Pre-execute actions on the relying party context info.
|
protected org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType |
getDelegationRestrictionCondition(org.opensaml.saml.saml2.core.Conditions conditions)
Get the DelegationRestrictionType Condition from the supplied Conditions, if present.
|
protected Long |
getPolicyMaxDelegationChainLength(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Get the effective maximum delegation chain length allowed by policy.
|
protected Long |
getTokenDelegationChainLength(org.opensaml.saml.saml2.core.Assertion token)
Get the length of the delegation chain in the presented token.
|
void |
setAssertionTokenStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
Set the strategy used to locate the inbound assertion token to process.
|
void |
setPolicyMaxChainLengthStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,Long> strategy)
Set the strategy used to resolve the policy maximum delegation chain length.
|
void |
setRelyingPartyContextLookupStrategy(Function<org.opensaml.profile.context.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 Function<org.opensaml.profile.context.ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> assertionTokenStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,Long> policyMaxChainLengthStrategy
private org.opensaml.saml.saml2.core.Assertion assertionToken
private Long policyMaxChainLength
private Long tokenChainLength
private Predicate<org.opensaml.profile.context.ProfileRequestContext> delegationPredicate
public void setPolicyMaxChainLengthStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,Long> strategy)
strategy - the strategypublic void setAssertionTokenStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Assertion> strategy)
strategy - lookup strategypublic void setRelyingPartyContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,RelyingPartyContext> strategy)
RelyingPartyContext.strategy - strategy used to locate the current RelyingPartyContextprotected boolean doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doPreExecute in class org.opensaml.profile.action.AbstractConditionalProfileActionprotected boolean doPreExecuteInbound(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current profile request contextdoExecute(ProfileRequestContext) should proceedprotected boolean doPreExecuteRelyingParty(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current profile request contextdoExecute(ProfileRequestContext) should proceedprotected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doExecute in class org.opensaml.profile.action.AbstractProfileActionprotected boolean checkAllowedDelegate(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
SSOSProfileConfiguration.getDelegationPredicate().profileRequestContext - the current request contextprotected boolean checkTokenDelegationChainLength(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current request contextprotected Long getTokenDelegationChainLength(@Nonnull org.opensaml.saml.saml2.core.Assertion token)
token - the token to evaluateprotected org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType getDelegationRestrictionCondition(@Nullable org.opensaml.saml.saml2.core.Conditions conditions)
conditions - the Assertion Conditions to process@Nonnull protected Long getPolicyMaxDelegationChainLength(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current request contextCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.