Class FinalizeMultiFactorAuthentication

  • 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 FinalizeMultiFactorAuthentication
    extends net.shibboleth.idp.authn.AbstractAuthenticationAction
    An authentication action that completes MFA by producing a final AuthenticationResult out of whatever constituent parts and pieces exist, by means of an overridable function, storing it in the AuthenticationContext and preparing a fresh SubjectCanonicalizationContext to operate on.
    Event:
    EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, AuthnEventIds.INVALID_AUTHN_CTX
    Precondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class).getSubcontext(
          MultiFactorAuthenticationContext.class) != null
    Postcondition:
    ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAuthenticationResult() != null
    ,
    ProfileRequestContext.getSubcontext(SubjectCanonicalizationContext.class) != null
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.slf4j.Logger log
      Class logger.
      private net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext mfaContext
      A subordinate MultiFactorAuthenticationContext, if any.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> multiFactorContextLookupStrategy
      Lookup function for the context to evaluate.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​String> requesterLookupStrategy
      Function used to obtain the requester ID.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​String> responderLookupStrategy
      Function used to obtain the responder ID.
      private Predicate<org.opensaml.profile.context.ProfileRequestContext> resultCachingPredicate
      Predicate to apply when setting AuthenticationResult cacheability.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.AuthenticationResult> resultMergingStrategy
      Strategy function to produce a final, merged result.
    • 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)
      protected void doInitialize()
      protected boolean doPreExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
      void setMultiFactorContextLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> strategy)
      Set the lookup strategy to use for the context to evaluate.
      void setRequesterLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set the strategy used to locate the requester ID for canonicalization.
      void setResponderLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set the strategy used to locate the responder ID for canonicalization.
      void setResultCachingPredicate​(Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
      Set predicate to apply to determine cacheability of AuthenticationResult.
      void setResultMergingStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.AuthenticationResult> strategy)
      Set the result merging strategy to use.
      • Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction

        doExecute, 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, 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.
      • multiFactorContextLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext> multiFactorContextLookupStrategy
        Lookup function for the context to evaluate.
      • resultMergingStrategy

        @NonnullAfterInit
        private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.AuthenticationResult> resultMergingStrategy
        Strategy function to produce a final, merged result.
      • resultCachingPredicate

        @Nullable
        private Predicate<org.opensaml.profile.context.ProfileRequestContext> resultCachingPredicate
        Predicate to apply when setting AuthenticationResult cacheability.
      • requesterLookupStrategy

        @Nullable
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> requesterLookupStrategy
        Function used to obtain the requester ID.
      • responderLookupStrategy

        @Nullable
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> responderLookupStrategy
        Function used to obtain the responder ID.
      • mfaContext

        @Nullable
        private net.shibboleth.idp.authn.context.MultiFactorAuthenticationContext mfaContext
        A subordinate MultiFactorAuthenticationContext, if any.
    • Constructor Detail

      • FinalizeMultiFactorAuthentication

        public FinalizeMultiFactorAuthentication()
        Constructor.
    • Method Detail

      • setMultiFactorContextLookupStrategy

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

        public void setResultMergingStrategy​(@Nullable
                                             Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.idp.authn.AuthenticationResult> strategy)
        Set the result merging strategy to use.
        Parameters:
        strategy - result merging strategy
      • setResultCachingPredicate

        public void setResultCachingPredicate​(@Nullable
                                              Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
        Set predicate to apply to determine cacheability of AuthenticationResult.
        Parameters:
        predicate - predicate to apply, or null
      • setRequesterLookupStrategy

        public void setRequesterLookupStrategy​(@Nullable
                                               Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set the strategy used to locate the requester ID for canonicalization.
        Parameters:
        strategy - lookup strategy
      • setResponderLookupStrategy

        public void setResponderLookupStrategy​(@Nullable
                                               Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set the strategy used to locate the responder ID for canonicalization.
        Parameters:
        strategy - lookup strategy
      • doInitialize

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                       @Nonnull
                                       net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)
        Overrides:
        doPreExecute in class net.shibboleth.idp.authn.AbstractAuthenticationAction
      • 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