Class PopulateAuthenticationContext

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.profile.action.ProfileAction, Aware, MessageSource, MessageSourceAware, Action

    public class PopulateAuthenticationContext
    extends net.shibboleth.idp.authn.AbstractAuthenticationAction
    An action that populates an AuthenticationContext with the AuthenticationFlowDescriptor objects configured into the IdP, potential flows filtered by flow IDs from a lookup function.

    If a RequestedPrincipalContext child is found, then optionally a customized PrincipalEvalPredicateFactoryRegistry will be installed into it.

    The flow IDs used for filtering must omit the AuthenticationFlowDescriptor.FLOW_ID_PREFIX prefix.

    Event:
    EventIds.PROCEED_EVENT_ID
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
    Postcondition:
    The AuthenticationContext is modified as above.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<String>> activeFlowsLookupStrategy
      Lookup function for the flow IDs to activate from within the available set.
      private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> availableFlows
      All of the known flows in the system.
      private net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry evalRegistry
      The registry of predicate factories for custom principal evaluation.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​String> fixedEventLookupStrategy
      Optional lookup strategy for triggering credential validators to return a fixed event for testing.
      private org.slf4j.Logger log
      Class logger.
      private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> potentialFlows
      The flows to make available for possible use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
      net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry getPrincipalPredicateFactoryEvalRegistry()
      Get the registry of predicate factories for custom principal evaluation.
      void setActiveFlowsLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<String>> strategy)
      Set the lookup strategy to use for the authentication flows to activate.
      void setAvailableFlows​(Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)
      Set the flows known to the system.
      void setFixedEventLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set optional lookup strategy to return a fixed event to return from credential validation to exercise error and warning logic.
      void setPotentialFlows​(Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)
      Set the flows to make available for use (a subset of the available ones).
      void setPrincipalEvalPredicateFactoryRegistry​(net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry registry)
      Set the registry of predicate factories for custom principal evaluation.
      • Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction

        doExecute, doPreExecute, doPreExecute, setAuthenticationContextLookupStrategy
      • 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, doInitialize, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • log

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

        @Nonnull
        @NonnullElements
        private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> availableFlows
        All of the known flows in the system.
      • potentialFlows

        @Nonnull
        @NonnullElements
        private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> potentialFlows
        The flows to make available for possible use.
      • activeFlowsLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<String>> activeFlowsLookupStrategy
        Lookup function for the flow IDs to activate from within the available set.
      • evalRegistry

        @Nullable
        private net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry evalRegistry
        The registry of predicate factories for custom principal evaluation.
      • fixedEventLookupStrategy

        @Nullable
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> fixedEventLookupStrategy
        Optional lookup strategy for triggering credential validators to return a fixed event for testing.
    • Constructor Detail

      • PopulateAuthenticationContext

        PopulateAuthenticationContext()
        Constructor.
    • Method Detail

      • setAvailableFlows

        public void setAvailableFlows​(@Nonnull @NonnullElements
                                      Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)
        Set the flows known to the system.
        Parameters:
        flows - the flows known to the system
      • setPotentialFlows

        public void setPotentialFlows​(@Nonnull @NonnullElements
                                      Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)
        Set the flows to make available for use (a subset of the available ones).
        Parameters:
        flows - the flows to make available for use
        Since:
        3.3.0
      • setActiveFlowsLookupStrategy

        public void setActiveFlowsLookupStrategy​(@Nonnull
                                                 Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<String>> strategy)
        Set the lookup strategy to use for the authentication flows to activate.
        Parameters:
        strategy - lookup strategy
      • getPrincipalPredicateFactoryEvalRegistry

        @Nonnull
        public net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry getPrincipalPredicateFactoryEvalRegistry()
        Get the registry of predicate factories for custom principal evaluation.
        Returns:
        predicate factory registry
      • setPrincipalEvalPredicateFactoryRegistry

        public void setPrincipalEvalPredicateFactoryRegistry​(@Nonnull
                                                             net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry registry)
        Set the registry of predicate factories for custom principal evaluation.
        Parameters:
        registry - predicate factory registry
      • setFixedEventLookupStrategy

        public void setFixedEventLookupStrategy​(@Nullable
                                                Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set optional lookup strategy to return a fixed event to return from credential validation to exercise error and warning logic.
        Parameters:
        strategy - lookup strategy
        Since:
        3.4.0
      • doExecute

        protected void doExecute​(@Nonnull
                                 org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                 @Nonnull
                                 net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction