Class AddDelegationPolicyToAssertion
- 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.AddDelegationPolicyToAssertion
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
@Prototype public class AddDelegationPolicyToAssertion extends AbstractProfileAction
Action which adds aDelegationPolicyelement to theAdviceof anAssertion.The assertion to modify is determined by the strategy set by
setAssertionLookupStrategy(Function).The maximum chain delegation length value for the added policy element is as follows:
- If an inbound assertion token is present as determined by the strategy set by
setAssertionTokenStrategy(Function), the value is obtained from the policy contained within the firstDelegationPolicyelement of that assertion'sAdviceelement. - Otherwise the request is assumed to be the initial SSO request, so the value is determined by
the requesting SP's profile configuration value
BrowserSSOProfileConfiguration.getMaximumTokenDelegationChainLength(ProfileRequestContext). - If neither of these approaches produces a value, a default value is used
DEFAULT_POLICY_MAX_CHAIN_LENGTH
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classAddDelegationPolicyToAssertion.AssertionStrategyDefault strategy for obtaining assertion to modify.
-
Field Summary
Fields Modifier and Type Field Description private AssertionassertionThe assertion to modify.private Function<ProfileRequestContext,Assertion>assertionLookupStrategyStrategy used to locate theAssertionto operate on.private Function<ProfileRequestContext,Assertion>assertionTokenStrategyFunction used to resolve the inbound assertion token to process.private AssertionattestedAssertionThe inbound delegated Assertion that was attested.static LongDEFAULT_POLICY_MAX_CHAIN_LENGTHDefault policy max chain length, when can't otherwise be derived.private org.slf4j.LoggerlogLogger.private LongmaxChainLengthThe max token delegation chain length value to add.private Function<ProfileRequestContext,RelyingPartyContext>relyingPartyContextLookupStrategyStrategy used to lookup the RelyingPartyContext.
-
Constructor Summary
Constructors Constructor Description AddDelegationPolicyToAssertion()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)protected LongresolveMaxChainLength(ProfileRequestContext profileRequestContext)Resolve the max token delegation chain length value to add to the assertion.voidsetAssertionLookupStrategy(Function<ProfileRequestContext,Assertion> strategy)Set the strategy used to locate theAssertionto operate on.voidsetAssertionTokenStrategy(Function<ProfileRequestContext,Assertion> strategy)Set the strategy used to locate the inbound assertion token to process.voidsetRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)Set the strategy used to locate the currentRelyingPartyContext.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, 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, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
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 Detail
-
DEFAULT_POLICY_MAX_CHAIN_LENGTH
@Nonnull public static final Long DEFAULT_POLICY_MAX_CHAIN_LENGTH
Default policy max chain length, when can't otherwise be derived.
-
log
@Nonnull private org.slf4j.Logger log
Logger.
-
assertionLookupStrategy
@Nonnull private Function<ProfileRequestContext,Assertion> assertionLookupStrategy
Strategy used to locate theAssertionto operate on.
-
assertionTokenStrategy
@Nonnull private Function<ProfileRequestContext,Assertion> assertionTokenStrategy
Function used to resolve the inbound assertion token to process.
-
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Strategy used to lookup the RelyingPartyContext.
-
assertion
@Nullable private Assertion assertion
The assertion to modify.
-
attestedAssertion
@Nullable private Assertion attestedAssertion
The inbound delegated Assertion that was attested.
-
maxChainLength
@Nullable private Long maxChainLength
The max token delegation chain length value to add.
-
-
Method Detail
-
setAssertionTokenStrategy
public void setAssertionTokenStrategy(@Nonnull Function<ProfileRequestContext,Assertion> strategy)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
-
setAssertionLookupStrategy
public void setAssertionLookupStrategy(@Nonnull Function<ProfileRequestContext,Assertion> strategy)Set the strategy used to locate theAssertionto operate on.- Parameters:
strategy- strategy used to locate theAssertionto operate on
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
resolveMaxChainLength
@Nonnull protected Long resolveMaxChainLength(@Nonnull ProfileRequestContext profileRequestContext)
Resolve the max token delegation chain length value to add to the assertion.- Parameters:
profileRequestContext- the current profile request context- Returns:
- the max chain length value
-
-