public class AddDelegationRestrictionToAssertions extends AbstractProfileAction
DelegationRestrictionType Condition to each Assertion
contained within the outbound Response.
If the inbound assertion token specified in LibertySSOSContext contains an existing
DelegationRestrictionType condition, it is cloned, and the current SAML presenter entityID
is added as a new Delegate. Otherwise a new instance of DelegationRestrictionType
is created and a single new Delegate added.
In both cases the new delegate entityID is obtained from the SAMLPresenterEntityContext located
using the corresponding lookup function. The new delegate is augmented with the SAML subject confirmation method
obtained from the current LibertySSOSContext.
EventIds.INVALID_MSG_CTX, EventIds.INVALID_PROFILE_CTX, EventIds.MESSAGE_PROC_ERROR| Modifier and Type | Field and Description |
|---|---|
private List<org.opensaml.saml.saml2.core.Assertion> |
assertions
List of assertions to modify.
|
private org.opensaml.saml.saml2.core.Assertion |
attestedAssertion
The delegated Assertion that was attested.
|
private String |
attestedSubjectConfirmationMethod
The subject confirmation method successfully used to confirm the assertion by the presenter.
|
private DateTime |
delegationInstant
The instant of delegation.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,LibertySSOSContext> |
libertyContextLookupStrategy
Function used to resolve the Liberty context to populate.
|
private org.slf4j.Logger |
log
Class logger.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.common.messaging.context.SAMLPresenterEntityContext> |
presenterContextLookupStrategy
Strategy used to locate the SAMLPresenterEntityContext.
|
private String |
presenterEntityID
The presenting entity which successfully attested the Assertion token.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Response> |
responseLookupStrategy
Strategy used to locate the Response to operate on.
|
| Constructor and Description |
|---|
AddDelegationRestrictionToAssertions()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDelegationRestriction(org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
org.opensaml.saml.saml2.core.Conditions conditions)
Add a delegation restriction condition to the specified conditions.
|
protected org.opensaml.saml.ext.saml2delrestrict.Delegate |
buildDelegate(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Build the Delegate child for the DelegationRestrictionType Condition,
based on the current request context.
|
protected org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType |
buildDelegationRestriction(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Using the existing attested Assertion from the presenter as a context, build the
appropriate DelegationRestrictionType Condition.
|
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
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.
|
void |
setLibertyContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,LibertySSOSContext> strategy)
Set the strategy used to locate the
LibertySSOSContext to populate. |
void |
setPresenterLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.common.messaging.context.SAMLPresenterEntityContext> strategy)
Set the strategy used to locate the
SAMLPresenterEntityContext. |
void |
setResponseLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Response> strategy)
Set the strategy used to locate the Response to operate on.
|
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, isInitialized@Nonnull private final org.slf4j.Logger log
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Response> responseLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.common.messaging.context.SAMLPresenterEntityContext> presenterContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,LibertySSOSContext> libertyContextLookupStrategy
@Nullable private List<org.opensaml.saml.saml2.core.Assertion> assertions
@Nullable private org.opensaml.saml.saml2.core.Assertion attestedAssertion
@Nullable private String attestedSubjectConfirmationMethod
@Nullable private String presenterEntityID
public AddDelegationRestrictionToAssertions()
public void setLibertyContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,LibertySSOSContext> strategy)
LibertySSOSContext to populate.strategy - lookup strategypublic void setResponseLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.saml2.core.Response> strategy)
strategy - lookup strategypublic void setPresenterLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,org.opensaml.saml.common.messaging.context.SAMLPresenterEntityContext> strategy)
SAMLPresenterEntityContext.strategy - lookup strategyprotected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doPreExecute in class org.opensaml.profile.action.AbstractConditionalProfileActionprotected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doExecute in class org.opensaml.profile.action.AbstractProfileActionprotected void addDelegationRestriction(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull org.opensaml.saml.saml2.core.Conditions conditions)
profileRequestContext - the current profile request contextconditions - the conditions instance to modify@Nullable protected org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType buildDelegationRestriction(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current profile request context@Nullable protected org.opensaml.saml.ext.saml2delrestrict.DelegationRestrictionType getDelegationRestrictionCondition(@Nullable org.opensaml.saml.saml2.core.Conditions conditions)
conditions - the Assertion Conditions to process@Nonnull protected org.opensaml.saml.ext.saml2delrestrict.Delegate buildDelegate(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - theCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.