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
Audiencein theAudienceRestrictioncondition of the inboundAuthnRequest. - The presence of a
RequestedAttributewith nameLibertyConstants.SERVICE_TYPE_SSOSin 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
Credentialinstances 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 AttributeConsumingServiceThe AttributeConsumingService for the SAML peer entity.private List<Credential>The subject confirmation credentials.private CredentialResolverThe credential resolver used to resolve HoK Credentials for the peer.private DelegationRequestDefault delegation request value.private booleanWhether delegation is allowed for the current relying party.Strategy used to lookup theDelegationContext.private DelegationRequestThe delegation requested state for the current request.private final org.slf4j.LoggerClass logger.private RelyingPartyContextThe current RelyingPartyContext.Strategy used to lookup the RelyingPartyContext.private StringThe entityID of the SAML relying party.private StringThe entityID of the local responder entity.private RoleDescriptorThe RoleDescriptor for the SAML peer entity.Strategy used to lookup the SAMLMetadataContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcreateAndPopulateDelegationContext(ProfileRequestContext profileRequestContext) Create and populate theDelegationContextusing the available information.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecuteInbound(ProfileRequestContext profileRequestContext) Pre-execute actions on the inbound message.protected booleandoPreExecuteMetadata(ProfileRequestContext profileRequestContext) Pre-execute actions on the relying party metadata.protected booleandoPreExecuteRelyingParty(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 DelegationRequestgetDelegationRequested(ProfileRequestContext requestContext) Check whether issuance of a delegated token has been requested.private DelegationRequestgetDelegationRequestedByMetadata(ProfileRequestContext requestContext) Determine whether a delegation token was requested via the SP's SPSSODescriptor AttributeConsumingService.private booleanisDelegationRequestedByAudience(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.voidsetCredentialResolver(CredentialResolver resolver) Set theCredentialResolverinstance to use to resolve HoKCredential.voidsetDefaultDelegationRequested(DelegationRequest delegationRequest) Set the effective default value for whether request processing should proceed with issuance of a delegation token.voidSet the strategy used to locate the currentDelegationContext.voidSet the strategy used to locate the currentRelyingPartyContext.voidSet 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, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 theCredentialResolverinstance 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:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein 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:
doExecutein classAbstractProfileAction
-
createAndPopulateDelegationContext
Create and populate theDelegationContextusing 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
-