Class PopulateMultiFactorAuthenticationContext

  • 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 PopulateMultiFactorAuthenticationContext
    extends net.shibboleth.idp.authn.AbstractAuthenticationAction
    An action that creates and populates a MultiFactorAuthenticationContext with the set of transition rules to use for coordinating activity, the executing AuthenticationFlowDescriptor and with any active "factors" found, if an active result from the MFA flow is present in the AuthenticationContext.

    If the lookup strategy supplies no transition rules to use, then the AuthnEventIds.RESELECT_FLOW event is signaled.

    Event:
    EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, AuthnEventIds.RESELECT_FLOW
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
    Postcondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class).getSubcontext(
      MultiFactorAuthenticationContext.class) != null
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private class  PopulateMultiFactorAuthenticationContext.DefaultResultLookupStrategy
      Default strategy function to extract embedded AuthenticationResults from inside the AuthenticationResultPrincipal collection of an active AuthenticationResult of the currently executing flow.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<net.shibboleth.idp.authn.AuthenticationResult>> activeResultLookupStrategy
      Lookup strategy for active "factors" that may already be usable.
      private org.slf4j.Logger log
      Class logger.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> multiFactorContextCreationStrategy
      Lookup/creation function for the context to populate.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​Map<String,​net.shibboleth.idp.authn.MultiFactorAuthenticationTransition>> transitionMapLookupStrategy
      Lookup strategy for obtaining the map of transition rules to 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)
      void setActiveResultLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<net.shibboleth.idp.authn.AuthenticationResult>> strategy)
      Set the lookup strategy for any active "factors" that may be reusable.
      void setMultiFactorContextCreationStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> strategy)
      Set the lookup/creation strategy to use for the context to populate.
      void setTransitionMapLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​Map<String,​net.shibboleth.idp.authn.MultiFactorAuthenticationTransition>> strategy)
      Set the strategy to lookup the map of transition rules to apply.
      • 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.
      • transitionMapLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​Map<String,​net.shibboleth.idp.authn.MultiFactorAuthenticationTransition>> transitionMapLookupStrategy
        Lookup strategy for obtaining the map of transition rules to use.
      • multiFactorContextCreationStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> multiFactorContextCreationStrategy
        Lookup/creation function for the context to populate.
      • activeResultLookupStrategy

        @Nullable
        private Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<net.shibboleth.idp.authn.AuthenticationResult>> activeResultLookupStrategy
        Lookup strategy for active "factors" that may already be usable.
    • Constructor Detail

      • PopulateMultiFactorAuthenticationContext

        PopulateMultiFactorAuthenticationContext()
        Constructor.
    • Method Detail

      • setTransitionMapLookupStrategy

        public void setTransitionMapLookupStrategy​(@Nonnull
                                                   Function<org.opensaml.profile.context.ProfileRequestContext,​Map<String,​net.shibboleth.idp.authn.MultiFactorAuthenticationTransition>> strategy)
        Set the strategy to lookup the map of transition rules to apply.
        Parameters:
        strategy - lookup strategy
      • setMultiFactorContextCreationStrategy

        public void setMultiFactorContextCreationStrategy​(@Nonnull
                                                          Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> strategy)
        Set the lookup/creation strategy to use for the context to populate.
        Parameters:
        strategy - lookup/creation strategy
      • setActiveResultLookupStrategy

        public void setActiveResultLookupStrategy​(@Nullable
                                                  Function<org.opensaml.profile.context.ProfileRequestContext,​Collection<net.shibboleth.idp.authn.AuthenticationResult>> strategy)
        Set the lookup strategy for any active "factors" that may be reusable.

        The default strategy is to look for an active AuthenticationResult of the flow currently being attempted, and check within it for AuthenticationResultPrincipal objects.

        Parameters:
        strategy - lookup strategy
      • 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