Class DecorateDelegatedAssertion
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.DecorateDelegatedAssertion
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
A profile action which decorates instances of
Assertion
appropriately for use as delegation tokens.
An instance of DelegationContext
is resolved via the strategy set via
setDelegationContextLookupStrategy(Function)
. If no delegation context is found
or if DelegationContext.isIssuingDelegatedAssertion()
is false, then no decoration
occurs.
The decoration consists of 3 primary parts:
-
A holder-of-key
SubjectConfirmation
is added to the assertion'sSubject
. The credentials used are taken fromDelegationContext.getSubjectConfirmationCredentials()
. -
An additional
Audience
is added to the assertion conditionAudienceRestriction
, indicating the IdP's own entityID as an acceptable audience. The IdP entityID is resolved from the activeRelyingPartyContext
, which is resolved via the strategy set bysetRelyingPartyContextLookupStrategy(Function)
. -
An additional
Attribute
is added to the assertion'sAttributeStatement
containing anEndpointReference
, indicating the location and other info necessary for the recipient to present the delegated assertion at the IdP for delegated SSO. The attribute name is a URI type with nameLibertyConstants.SERVICE_TYPE_SSOS
. The endpoint URL is either set directly on this action viasetLibertySSOSEndpointURL(String)
, or is resolved via the strategysetLibertySSOSEndpointURLLookupStrategy(Function)
.
- Event:
EventIds.INVALID_PROFILE_CTX
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Default strategy for obtaining assertion to modify.static class
Strategy that builds the SSOS endpoint URL based on the current HTTP request using default values for scheme, port and URI path suffix. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,
List<Assertion>> Strategy used to locate theAssertion
s on which to operate.The list of assertions on which to operate.private DelegationContext
The delegation context instance to be populated.Strategy used to lookup theDelegationContext
.private NamedKeyInfoGeneratorManager
The manager used to generate KeyInfo instances from Credentials.private String
The URL at which the IdP will accept Liberty ID-WSF SSOS requests.private Function<Pair<ProfileRequestContext,
javax.servlet.http.HttpServletRequest>, String> The strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests.private final org.slf4j.Logger
Class logger.private RelyingPartyContext
The current RelyingPartyContext.Strategy used to lookup the RelyingPartyContext.private String
The entityID of the SAML relying party.private String
The entityID of the local responder entity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addIdPAudienceRestriction
(ProfileRequestContext requestContext, Assertion assertion) An an AudienceRestriction condition indicating the IdP as an acceptable Audience.private void
addLibertySSOSEPRAttribute
(ProfileRequestContext requestContext, Assertion assertion) Add Liberty SSOS service Endpoint Reference (EPR) attribute to Assertion's AttributeStatement.private void
addSAMLPeerSubjectConfirmation
(ProfileRequestContext requestContext, Assertion assertion) Add SubjectConfirmation to the Assertion Subject to allow confirmation when wielded by the SAML requester.private XMLObject
buildLibertSSOSEPRAttributeValue
(ProfileRequestContext requestContext, Assertion assertion) Build the Liberty SSOS EPR AttributeValue object.private void
decorateDelegatedAssertion
(ProfileRequestContext requestContext) Decorate the Assertion to allow use as a delegated security token by the SAML requester.protected void
doExecute
(ProfileRequestContext profileRequestContext) protected void
protected boolean
doPreExecute
(ProfileRequestContext profileRequestContext) protected boolean
doPreExecuteDelegationInfo
(ProfileRequestContext profileRequestContext) Pre-execute actions on the delegation-specific info.protected boolean
doPreExecuteRelyingParty
(ProfileRequestContext profileRequestContext) Pre-execute actions on the relying party context info.private void
resolveLibertySSOSEndpointURL
(ProfileRequestContext profileRequestContext) Resolve and store the effective Liberty SSOS endpoint URL to use.void
Set the strategy used to locate theAssertion
to operate on.void
Set the strategy used to locate the currentDelegationContext
.void
void
Set the statically-configured URL at which the IdP will accept Liberty ID-WSF SSOS requests.void
setLibertySSOSEndpointURLLookupStrategy
(Function<Pair<ProfileRequestContext, javax.servlet.http.HttpServletRequest>, String> strategy) Set strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests.void
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, 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
private final org.slf4j.Logger logClass logger. -
libertySSOSEndpointURL
The URL at which the IdP will accept Liberty ID-WSF SSOS requests. -
libertySSOSEndpointURLLookupStrategy
@Nullable private Function<Pair<ProfileRequestContext,javax.servlet.http.HttpServletRequest>, libertySSOSEndpointURLLookupStrategyString> The strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to lookup the RelyingPartyContext. -
delegationContextLookupStrategy
Strategy used to lookup theDelegationContext
. -
assertionLookupStrategy
Strategy used to locate theAssertion
s on which to operate. -
keyInfoGeneratorManager
The manager used to generate KeyInfo instances from Credentials. -
delegationContext
The delegation context instance to be populated. -
assertions
The list of assertions on which to operate. -
relyingPartyContext
The current RelyingPartyContext. -
responderId
The entityID of the local responder entity. -
relyingPartyId
The entityID of the SAML relying party.
-
-
Constructor Details
-
DecorateDelegatedAssertion
public DecorateDelegatedAssertion()Constructor.
-
-
Method Details
-
setLibertySSOSEndpointURL
Set the statically-configured URL at which the IdP will accept Liberty ID-WSF SSOS requests.- Parameters:
url
- the Liberty ID-WSF SSOS endpoint URL, or null
-
setLibertySSOSEndpointURLLookupStrategy
public void setLibertySSOSEndpointURLLookupStrategy(@Nullable Function<Pair<ProfileRequestContext, javax.servlet.http.HttpServletRequest>, String> strategy) Set strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests.- Parameters:
strategy
- the Liberty ID-WSF SSOS endpoint URL lookup strategy, or null
-
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
-
setDelegationContextLookupStrategy
public void setDelegationContextLookupStrategy(@Nonnull Function<ProfileRequestContext, DelegationContext> strategy) Set the strategy used to locate the currentDelegationContext
.- Parameters:
strategy
- strategy used to locate the currentDelegationContext
-
setAssertionLookupStrategy
public void setAssertionLookupStrategy(@Nonnull Function<ProfileRequestContext, List<Assertion>> strategy) Set the strategy used to locate theAssertion
to operate on.- Parameters:
strategy
- strategy used to locate theAssertion
to operate on
-
setKeyInfoGeneratorManager
- Parameters:
manager
- the manager instance to use
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecute
in classAbstractConditionalProfileAction
-
doPreExecuteDelegationInfo
Pre-execute actions on the delegation-specific info.- 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
-
resolveLibertySSOSEndpointURL
Resolve and store the effective Liberty SSOS endpoint URL to use.- Parameters:
profileRequestContext
- the current request context
-
decorateDelegatedAssertion
private void decorateDelegatedAssertion(@Nonnull ProfileRequestContext requestContext) throws EventException Decorate the Assertion to allow use as a delegated security token by the SAML requester.- Parameters:
requestContext
- the current request context- Throws:
EventException
- to propagate events
-
addLibertySSOSEPRAttribute
private void addLibertySSOSEPRAttribute(@Nonnull ProfileRequestContext requestContext, @Nonnull Assertion assertion) Add Liberty SSOS service Endpoint Reference (EPR) attribute to Assertion's AttributeStatement.- Parameters:
requestContext
- the current request contextassertion
- the delegated assertion being issued
-
buildLibertSSOSEPRAttributeValue
@Nonnull private XMLObject buildLibertSSOSEPRAttributeValue(@Nonnull ProfileRequestContext requestContext, @Nonnull Assertion assertion) Build the Liberty SSOS EPR AttributeValue object.- Parameters:
requestContext
- the current request contextassertion
- the delegated assertion being issued- Returns:
- the AttributeValue object containing the EPR
-
addIdPAudienceRestriction
private void addIdPAudienceRestriction(@Nonnull ProfileRequestContext requestContext, @Nonnull Assertion assertion) An an AudienceRestriction condition indicating the IdP as an acceptable Audience.- Parameters:
requestContext
- the current request contextassertion
- the assertion being isued
-
addSAMLPeerSubjectConfirmation
private void addSAMLPeerSubjectConfirmation(@Nonnull ProfileRequestContext requestContext, @Nonnull Assertion assertion) throws EventException Add SubjectConfirmation to the Assertion Subject to allow confirmation when wielded by the SAML requester.- Parameters:
requestContext
- the current request contextassertion
- the assertion being issued- Throws:
EventException
- to propagate event signals
-