Class EvaluateDelegationPolicy
java.lang.Object
net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.saml2.profile.delegation.impl.EvaluateDelegationPolicy
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
Action which implements policy controls to decide whether an SSO request based
on a delegated
Assertion
token is allowed to proceed.
Two policy checks are performed:
-
The active
SSOSProfileConfiguration
is resolved and its predicate is applied. If the predicate evaluates to false, the request is not allowed. An example predicate commonly used here isAllowedSAMLPresentersPredicate
. -
The length of the delegation chain as indicated in the inbound assertion token's
DelegationRestrictionType
condition is evaluated against a policy maximum resolved via the strategy set bysetPolicyMaxChainLengthStrategy(Function)
, or fromBrowserSSOProfileConfiguration.DEFAULT_DELEGATION_CHAIN_LENGTH
if no value can otherwise be resolved. If the chain ofDelegate
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 firstDelegationPolicy
contained within the inbound assertion token'sAdvice
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Default strategy used to resolve the policy maximum token delegation chain length. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Assertion
The inbound delegated assertion token being evaluated.private Function<ProfileRequestContext,
Assertion> Function used to resolve the assertion token to process.private boolean
Whether the request is allowed to proceed.private org.slf4j.Logger
Logger.private Long
The policy maximum token delegation chain length.private Function<ProfileRequestContext,
Long> Function used to resolve the policy maximum delegation chain length.Strategy used to lookup the RelyingPartyContext.private Long
The actual token delegation chain length. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkAllowedDelegate
(ProfileRequestContext profileRequestContext) Apply policy control.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
Get the length of the delegation chain in the presented token.void
Set the strategy used to locate the inbound assertion token to process.void
Set the strategy used to resolve the policy maximum delegation chain length.void
Set the strategy used to locate the currentRelyingPartyContext
.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logLogger. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to lookup the RelyingPartyContext. -
assertionTokenStrategy
Function used to resolve the assertion token to process. -
policyMaxChainLengthStrategy
Function used to resolve the policy maximum delegation chain length. -
assertionToken
The inbound delegated assertion token being evaluated. -
policyMaxChainLength
The policy maximum token delegation chain length. -
tokenChainLength
The actual token delegation chain length. -
delegationAllowed
private boolean delegationAllowedWhether the request is allowed to proceed.
-
-
Constructor Details
-
EvaluateDelegationPolicy
public EvaluateDelegationPolicy()Constructor.
-
-
Method Details
-
setPolicyMaxChainLengthStrategy
Set the strategy used to resolve the policy maximum delegation chain length.- Parameters:
strategy
- the strategy
-
setAssertionTokenStrategy
Set the strategy used to locate the inbound assertion token to process.- Parameters:
strategy
- lookup strategy
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set the strategy used to locate the currentRelyingPartyContext
.- Parameters:
strategy
- strategy used to locate the currentRelyingPartyContext
-
doPreExecute
- Overrides:
doPreExecute
in classAbstractConditionalProfileAction
-
doPreExecuteInbound
Pre-execute actions on the inbound message.- Parameters:
profileRequestContext
- the current profile request context- Returns:
- true iff
doExecute(ProfileRequestContext)
should proceed
-
doPreExecuteRelyingParty
Pre-execute actions on the relying party context info.- Parameters:
profileRequestContext
- the current profile request context- Returns:
- true iff
doExecute(ProfileRequestContext)
should proceed
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-
checkAllowedDelegate
Apply policy control.- Parameters:
profileRequestContext
- the current request context- Returns:
- true if check passes, false if not
-
checkTokenDelegationChainLength
protected boolean checkTokenDelegationChainLength(@Nonnull ProfileRequestContext profileRequestContext) Apply policy control which checks the actual token chain length against the policy maximum chain length.- Parameters:
profileRequestContext
- the current request context- Returns:
- true if check passes, false if not
-
getTokenDelegationChainLength
Get the length of the delegation chain in the presented token.- Parameters:
token
- the token to evaluate- Returns:
- the token delegation chain length
-
getDelegationRestrictionCondition
protected DelegationRestrictionType getDelegationRestrictionCondition(@Nullable Conditions conditions) Get the DelegationRestrictionType Condition from the supplied Conditions, if present.- Parameters:
conditions
- the Assertion Conditions to process- Returns:
- the DelegationRestrictionType Condition object, or null if not present
-
getPolicyMaxDelegationChainLength
@Nonnull protected Long getPolicyMaxDelegationChainLength(@Nonnull ProfileRequestContext profileRequestContext) Get the effective maximum delegation chain length allowed by policy.- Parameters:
profileRequestContext
- the current request context- Returns:
- the policy max delegation chain policy length
-