Class MultiFactorAuthenticationTransition


  • public class MultiFactorAuthenticationTransition
    extends Object
    A ruleset for managing the transition out of a step during the multi-factor authn flow.

    After each step/flow is successfully completed, this object supplies rules for determining what to do next with a bit of pseudo-SWF reinvention that allows an event to be mapped to a new flow to run by means of a function. If no mapping exists, or the function returns null, then the active event is simply raised as the result of the overall flow execution.

    Note that raising the "proceed" event from a previous step will cause the MFA flow itself to attempt successful completion by finalizing its result.

    Since:
    3.3.0
    • Constructor Detail

      • MultiFactorAuthenticationTransition

        public MultiFactorAuthenticationTransition()
        Constructor.
    • Method Detail

      • getNextFlowStrategy

        @Nonnull
        public Function<ProfileRequestContext,​String> getNextFlowStrategy​(@Nonnull @NotEmpty
                                                                                String event)
        Get the function to run to determine the next subflow to run.
        Parameters:
        event - the event to transition from
        Returns:
        flow determination strategy
      • setNextFlow

        public void setNextFlow​(@Nullable @NotEmpty
                                String flowId)
        Set the next flow to run directly, instead of using a strategy map.

        The transition rule is implicitly based on a "proceed" event occurring, and assumes no custom transitions for any other events.

        Parameters:
        flowId - fully-qualified flow ID to run
      • setNextFlowStrategy

        public void setNextFlowStrategy​(@Nonnull
                                        Function<ProfileRequestContext,​String> strategy)
        Set a function to run directly instead of using a strategy map.

        The transition rule is implicitly based on a "proceed" event occurring, and assumes no custom transitions for any other events.

        Parameters:
        strategy - function to run