Class PopulateDelegationContext
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
Assertion
token
is active, and populates a DelegationContext
appropriately.
The output of 3 different evaluations is combined to produce the final result:
-
Determination is made whether delegation is requested by the relying party, as a value of type
DelegationRequest
. Delegation may be requested via:- The inclusion of the IdP entityID as an
Audience
in theAudienceRestriction
condition of the inboundAuthnRequest
. - The presence of a
RequestedAttribute
with nameLibertyConstants.SERVICE_TYPE_SSOS
in the relying party's metadata viaAttributeConsumingService
.
- The inclusion of the IdP entityID as an
-
Determination is made whether issuance of a delegated token is allowed for the relying party,
based on the (predicate driven)
BrowserSSOProfileConfiguration.isAllowDelegation(ProfileRequestContext)
method. -
Holder-of-key subject confirmation
Credential
instances are resolved for the relying party from its resolved metadataRoleDescriptor
.
If 1) delegation is allowed, 2) subject confirmation credentials were resolved, and 3) request status was either
DelegationRequest.REQUESTED_OPTIONAL
or DelegationRequest.REQUESTED_REQUIRED
,
a DelegationContext
is populated indicating issuance of delegated token to be active, and containing the
resolved subject confirmation credentials.
If request status was DelegationRequest.REQUESTED_REQUIRED
but delegation was not allowed and/or no
subject confirmation credentials could be resolved, a fatal event is produced.
Otherwise, issuance of a delegated token is not active and so no DelegationContext
is populated.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AttributeConsumingService
The AttributeConsumingService for the SAML peer entity.private List<Credential>
The subject confirmation credentials.private CredentialResolver
The credential resolver used to resolve HoK Credentials for the peer.private DelegationRequest
Default delegation request value.private boolean
Whether delegation is allowed for the current relying party.Strategy used to lookup theDelegationContext
.private DelegationRequest
The delegation requested state for the current request.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.private RoleDescriptor
The RoleDescriptor for the SAML peer entity.Strategy used to lookup the SAMLMetadataContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
createAndPopulateDelegationContext
(ProfileRequestContext profileRequestContext) Create and populate theDelegationContext
using the available information.protected void
doExecute
(ProfileRequestContext profileRequestContext) protected void
protected boolean
doPreExecute
(ProfileRequestContext profileRequestContext) protected boolean
doPreExecuteInbound
(ProfileRequestContext profileRequestContext) Pre-execute actions on the inbound message.protected boolean
doPreExecuteMetadata
(ProfileRequestContext profileRequestContext) Pre-execute actions on the relying party metadata.protected boolean
doPreExecuteRelyingParty
(ProfileRequestContext profileRequestContext) Pre-execute actions on the relying party context info.Get the effective default value for whether request processing should proceed with issuance of a delegation token.private DelegationRequest
getDelegationRequested
(ProfileRequestContext requestContext) Check whether issuance of a delegated token has been requested.private DelegationRequest
getDelegationRequestedByMetadata
(ProfileRequestContext requestContext) Determine whether a delegation token was requested via the SP's SPSSODescriptor AttributeConsumingService.private boolean
isDelegationRequestedByAudience
(ProfileRequestContext requestContext) Determine whether a delegation token was requested via the inbound AuthnRequest's Conditions' AudienceRestriction.private List<Credential>
resolveConfirmationCredentials
(ProfileRequestContext requestContext) Resolve the subject confirmation credentials.void
setCredentialResolver
(CredentialResolver resolver) Set theCredentialResolver
instance to use to resolve HoKCredential
.void
setDefaultDelegationRequested
(DelegationRequest delegationRequest) Set the effective default value for whether request processing should proceed with issuance of a delegation token.void
Set the strategy used to locate the currentDelegationContext
.void
Set the strategy used to locate the currentRelyingPartyContext
.void
Set the strategy used to locate the currentSAMLMetadataContext
.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, 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 final org.slf4j.Logger logClass logger. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to lookup the RelyingPartyContext. -
samlMetadataContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,SAMLMetadataContext> samlMetadataContextLookupStrategyStrategy used to lookup the SAMLMetadataContext. -
delegationContextLookupStrategy
Strategy used to lookup theDelegationContext
. -
defaultDelegationRequested
Default delegation request value. -
credentialResolver
The credential resolver used to resolve HoK Credentials for the peer. -
delegationRequested
The delegation requested state for the current request. -
relyingPartyContext
The current RelyingPartyContext. -
delegationAllowed
private boolean delegationAllowedWhether delegation is allowed for the current relying party. -
responderId
The entityID of the local responder entity. -
relyingPartyId
The entityID of the SAML relying party. -
roleDescriptor
The RoleDescriptor for the SAML peer entity. -
attributeConsumingService
The AttributeConsumingService for the SAML peer entity. -
confirmationCredentials
The subject confirmation credentials.
-
-
Constructor Details
-
PopulateDelegationContext
public PopulateDelegationContext()Constructor.
-
-
Method Details
-
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
-
setSAMLMetadataContextLookupStrategy
public void setSAMLMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SAMLMetadataContext> strategy) Set the strategy used to locate the currentSAMLMetadataContext
.- Parameters:
strategy
- strategy used to locate the currentSAMLMetadataContext
-
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
-
setCredentialResolver
Set theCredentialResolver
instance to use to resolve HoKCredential
.Typically this should be a metadata-based resolver which accepts input as the peer's
RoleDescriptor
.- Parameters:
resolver
- the resolver instance to use
-
getDefaultDelegationRequested
Get the effective default value for whether request processing should proceed with issuance of a delegation token.- Returns:
- the default value
-
setDefaultDelegationRequested
Set the effective default value for whether request processing should proceed with issuance of a delegation token.- Parameters:
delegationRequest
- the default delegation requested value
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
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
-
doPreExecuteMetadata
Pre-execute actions on the relying party metadata.- Parameters:
profileRequestContext
- the current profile request context- Returns:
- true iff
doExecute(ProfileRequestContext)
should proceed, false otherwise
-
doExecute
- Overrides:
doExecute
in classAbstractProfileAction
-
createAndPopulateDelegationContext
Create and populate theDelegationContext
using the available information.- Parameters:
profileRequestContext
- the current request context
-
resolveConfirmationCredentials
private List<Credential> resolveConfirmationCredentials(@Nonnull ProfileRequestContext requestContext) Resolve the subject confirmation credentials.- Parameters:
requestContext
- the current request context- Returns:
- the subject confirmation credentials, or null if not resolveable or there is an error
-
getDelegationRequested
Check whether issuance of a delegated token has been requested.- Parameters:
requestContext
- the current request context- Returns:
- true if delegation is requested, false otherwise
-
getDelegationRequestedByMetadata
@Nonnull private DelegationRequest getDelegationRequestedByMetadata(@Nonnull ProfileRequestContext requestContext) Determine whether a delegation token was requested via the SP's SPSSODescriptor AttributeConsumingService.- Parameters:
requestContext
- the current request context- Returns:
- DelegationRequest enum value as appropriate
-
isDelegationRequestedByAudience
Determine whether a delegation token was requested via the inbound AuthnRequest's Conditions' AudienceRestriction.- Parameters:
requestContext
- the current request context- Returns:
- true if the AudienceRestrictions condition contained the local entity Id, false otherwise
-