@Prototype public class DecorateDelegatedAssertion extends AbstractProfileAction
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:
SubjectConfirmation is added to the assertion's Subject. The credentials used
are taken from DelegationContext.getSubjectConfirmationCredentials().
Audience is added to the assertion condition AudienceRestriction, indicating
the IdP's own entityID as an acceptable audience. The IdP entityID is resolved from the active
RelyingPartyContext, which is resolved via the strategy set by
setRelyingPartyContextLookupStrategy(Function).
Attribute is added to the assertion's AttributeStatement containing an
EndpointReference, 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 name
LibertyConstants.SERVICE_TYPE_SSOS. The endpoint URL is either set directly on this action via
setLibertySSOSEndpointURL(String), or is resolved via the strategy
setLibertySSOSEndpointURLLookupStrategy(Function).
EventIds.INVALID_PROFILE_CTX| Modifier and Type | Class and Description |
|---|---|
private class |
DecorateDelegatedAssertion.AssertionStrategy
Default strategy for obtaining assertion to modify.
|
static class |
DecorateDelegatedAssertion.LibertySSOSEndpointURLStrategy
Strategy that builds the SSOS endpoint URL based on the current HTTP request
using default values for scheme, port and URI path suffix.
|
| Modifier and Type | Field and Description |
|---|---|
private Function<org.opensaml.profile.context.ProfileRequestContext,List<org.opensaml.saml.saml2.core.Assertion>> |
assertionLookupStrategy
Strategy used to locate the
Assertions on which to operate. |
private List<org.opensaml.saml.saml2.core.Assertion> |
assertions
The list of assertions on which to operate.
|
private DelegationContext |
delegationContext
The delegation context instance to be populated.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,DelegationContext> |
delegationContextLookupStrategy
Strategy used to lookup the {@link DelegationContext.
|
private org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager |
keyInfoGeneratorManager
The manager used to generate KeyInfo instances from Credentials.
|
private String |
libertySSOSEndpointURL
The URL at which the IdP will accept Liberty ID-WSF SSOS requests.
|
private Function<Pair<org.opensaml.profile.context.ProfileRequestContext,HttpServletRequest>,String> |
libertySSOSEndpointURLLookupStrategy
The strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests.
|
private org.slf4j.Logger |
log
Class logger.
|
private RelyingPartyContext |
relyingPartyContext
The current RelyingPartyContext.
|
private Function<org.opensaml.profile.context.ProfileRequestContext,RelyingPartyContext> |
relyingPartyContextLookupStrategy
Strategy used to lookup the RelyingPartyContext.
|
private String |
relyingPartyId
The entityID of the SAML relying party.
|
private String |
responderId
The entityID of the local responder entity.
|
| Constructor and Description |
|---|
DecorateDelegatedAssertion()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addIdPAudienceRestriction(org.opensaml.profile.context.ProfileRequestContext requestContext,
org.opensaml.saml.saml2.core.Assertion assertion)
An an AudienceRestriction condition indicating the IdP as an acceptable Audience.
|
private void |
addLibertySSOSEPRAttribute(org.opensaml.profile.context.ProfileRequestContext requestContext,
org.opensaml.saml.saml2.core.Assertion assertion)
Add Liberty SSOS service Endpoint Reference (EPR) attribute to Assertion's AttributeStatement.
|
private void |
addSAMLPeerSubjectConfirmation(org.opensaml.profile.context.ProfileRequestContext requestContext,
org.opensaml.saml.saml2.core.Assertion assertion)
Add SubjectConfirmation to the Assertion Subject to allow confirmation when wielded by the SAML requester.
|
private org.opensaml.core.xml.XMLObject |
buildLibertSSOSEPRAttributeValue(org.opensaml.profile.context.ProfileRequestContext requestContext,
org.opensaml.saml.saml2.core.Assertion assertion)
Build the Liberty SSOS EPR AttributeValue object.
|
private void |
decorateDelegatedAssertion(org.opensaml.profile.context.ProfileRequestContext requestContext)
Decorate the Assertion to allow use as a delegated security token by the SAML requester.
|
protected void |
doExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected void |
doInitialize() |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) |
protected boolean |
doPreExecuteDelegationInfo(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Pre-execute actions on the delegation-specific info.
|
protected boolean |
doPreExecuteRelyingParty(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Pre-execute actions on the relying party context info.
|
private void |
resolveLibertySSOSEndpointURL(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
Resolve and store the effective Liberty SSOS endpoint URL to use.
|
void |
setAssertionLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,List<org.opensaml.saml.saml2.core.Assertion>> strategy)
Set the strategy used to locate the
Assertion to operate on. |
void |
setDelegationContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,DelegationContext> strategy)
Set the strategy used to locate the current
DelegationContext. |
void |
setKeyInfoGeneratorManager(org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager manager)
Set the
KeyInfoGeneratorManager instance used to generate KeyInfo
from Credential. |
void |
setLibertySSOSEndpointURL(String url)
Set the statically-configured URL at which the IdP will accept Liberty ID-WSF SSOS requests.
|
void |
setLibertySSOSEndpointURLLookupStrategy(Function<Pair<org.opensaml.profile.context.ProfileRequestContext,HttpServletRequest>,String> strategy)
Set strategy used to resolve the URL at which the IdP will accept Liberty ID-WSF SSOS requests.
|
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, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitializedprivate final org.slf4j.Logger log
private String libertySSOSEndpointURL
@Nullable private Function<Pair<org.opensaml.profile.context.ProfileRequestContext,HttpServletRequest>,String> libertySSOSEndpointURLLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,DelegationContext> delegationContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,List<org.opensaml.saml.saml2.core.Assertion>> assertionLookupStrategy
Assertions on which to operate.@Nonnull private org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager keyInfoGeneratorManager
private DelegationContext delegationContext
private List<org.opensaml.saml.saml2.core.Assertion> assertions
private RelyingPartyContext relyingPartyContext
private String responderId
private String relyingPartyId
public void setLibertySSOSEndpointURL(@Nullable String url)
url - the Liberty ID-WSF SSOS endpoint URL, or nullpublic void setLibertySSOSEndpointURLLookupStrategy(@Nullable Function<Pair<org.opensaml.profile.context.ProfileRequestContext,HttpServletRequest>,String> strategy)
strategy - the Liberty ID-WSF SSOS endpoint URL lookup strategy, or nullpublic void setRelyingPartyContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,RelyingPartyContext> strategy)
RelyingPartyContext.strategy - strategy used to locate the current RelyingPartyContextpublic void setDelegationContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,DelegationContext> strategy)
DelegationContext.strategy - strategy used to locate the current DelegationContextpublic void setAssertionLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,List<org.opensaml.saml.saml2.core.Assertion>> strategy)
Assertion to operate on.strategy - strategy used to locate the Assertion to operate onpublic void setKeyInfoGeneratorManager(@Nonnull org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager manager)
KeyInfoGeneratorManager instance used to generate KeyInfo
from Credential.manager - the manager instance to useprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
doPreExecute in class org.opensaml.profile.action.AbstractConditionalProfileActionprotected boolean doPreExecuteDelegationInfo(@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.AbstractProfileActionprivate void resolveLibertySSOSEndpointURL(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
profileRequestContext - the current request contextprivate void decorateDelegatedAssertion(@Nonnull org.opensaml.profile.context.ProfileRequestContext requestContext)
requestContext - the current request contextprivate void addLibertySSOSEPRAttribute(@Nonnull org.opensaml.profile.context.ProfileRequestContext requestContext, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion)
requestContext - the current request contextassertion - the delegated assertion being issued@Nonnull private org.opensaml.core.xml.XMLObject buildLibertSSOSEPRAttributeValue(@Nonnull org.opensaml.profile.context.ProfileRequestContext requestContext, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion)
requestContext - the current request contextassertion - the delegated assertion being issuedprivate void addIdPAudienceRestriction(@Nonnull org.opensaml.profile.context.ProfileRequestContext requestContext, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion)
requestContext - the current request contextassertion - the assertion being isuedprivate void addSAMLPeerSubjectConfirmation(@Nonnull org.opensaml.profile.context.ProfileRequestContext requestContext, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion)
requestContext - the current request contextassertion - the assertion being issuedCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.