Class PopulateDelegationContext

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • defaultDelegationRequested

        private DelegationRequest defaultDelegationRequested
        Default delegation request value.
      • credentialResolver

        @Nonnull
        private CredentialResolver credentialResolver
        The credential resolver used to resolve HoK Credentials for the peer.
      • delegationRequested

        private DelegationRequest delegationRequested
        The delegation requested state for the current request.
      • relyingPartyContext

        private RelyingPartyContext relyingPartyContext
        The current RelyingPartyContext.
      • delegationAllowed

        private boolean delegationAllowed
        Whether delegation is allowed for the current relying party.
      • responderId

        private String responderId
        The entityID of the local responder entity.
      • relyingPartyId

        private String relyingPartyId
        The entityID of the SAML relying party.
      • roleDescriptor

        private RoleDescriptor roleDescriptor
        The RoleDescriptor for the SAML peer entity.
      • attributeConsumingService

        private AttributeConsumingService attributeConsumingService
        The AttributeConsumingService for the SAML peer entity.
      • confirmationCredentials

        private List<Credential> confirmationCredentials
        The subject confirmation credentials.
    • Constructor Detail

      • PopulateDelegationContext

        public PopulateDelegationContext()
        Constructor.
    • Method Detail

      • setCredentialResolver

        public void setCredentialResolver​(@Nonnull
                                          CredentialResolver resolver)
        Set the CredentialResolver instance to use to resolve HoK Credential.

        Typically this should be a metadata-based resolver which accepts input as the peer's RoleDescriptor.

        Parameters:
        resolver - the resolver instance to use
      • getDefaultDelegationRequested

        @Nonnull
        public DelegationRequest getDefaultDelegationRequested()
        Get the effective default value for whether request processing should proceed with issuance of a delegation token.
        Returns:
        the default value
      • setDefaultDelegationRequested

        public void setDefaultDelegationRequested​(@Nonnull
                                                  DelegationRequest delegationRequest)
        Set the effective default value for whether request processing should proceed with issuance of a delegation token.
        Parameters:
        delegationRequest - the default delegation requested value
      • doPreExecuteInbound

        protected boolean doPreExecuteInbound​(@Nonnull
                                              ProfileRequestContext profileRequestContext)
        Pre-execute actions on the inbound message.
        Parameters:
        profileRequestContext - the current profile request context
        Returns:
        true iff doExecute(ProfileRequestContext) should proceed
      • doPreExecuteRelyingParty

        protected boolean doPreExecuteRelyingParty​(@Nonnull
                                                   ProfileRequestContext profileRequestContext)
        Pre-execute actions on the relying party context info.
        Parameters:
        profileRequestContext - the current profile request context
        Returns:
        true iff doExecute(ProfileRequestContext) should proceed
      • doPreExecuteMetadata

        protected boolean doPreExecuteMetadata​(@Nonnull
                                               ProfileRequestContext profileRequestContext)
        Pre-execute actions on the relying party metadata.
        Parameters:
        profileRequestContext - the current profile request context
        Returns:
        true iff doExecute(ProfileRequestContext) should proceed, false otherwise
      • createAndPopulateDelegationContext

        private void createAndPopulateDelegationContext​(ProfileRequestContext profileRequestContext)
        Create and populate the DelegationContext 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

        private DelegationRequest getDelegationRequested​(@Nonnull
                                                         ProfileRequestContext requestContext)
        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

        private boolean isDelegationRequestedByAudience​(@Nonnull
                                                        ProfileRequestContext requestContext)
        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