Class MultiFactorAuthenticationTransition

java.lang.Object
net.shibboleth.idp.authn.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
  • Field Details

  • Constructor Details

    • MultiFactorAuthenticationTransition

      public MultiFactorAuthenticationTransition()
      Constructor.
  • Method Details

    • 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
    • getNextFlowStrategyMap

      @Nonnull @NonnullElements @Live Map<String,​Function<ProfileRequestContext,​String>> getNextFlowStrategyMap()
      Get the map of transition rules to follow.
      Returns:
      a map of transition functions keyed by event ID
    • setNextFlowStrategyMap

      public void setNextFlowStrategyMap​(@Nonnull @NonnullElements Map<String,​Object> map)
      Set the map of transition rules to follow.

      The values in the map must be either a String identifying the flow ID to run, or a Function<ProfileRequestContext,String> to execute.

      Parameters:
      map - map of transition rules
    • 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