Package net.shibboleth.idp.authn

# 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 Summary

Fields
Modifier and Type
Field
Description
`private Map<String,Function<ProfileRequestContext,String>>`
`nextFlowStrategyMap`
A function that determines the next flow to execute.

## Constructor Summary

Constructors
Constructor
Description
`MultiFactorAuthenticationTransition()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Function<ProfileRequestContext,String>`
`getNextFlowStrategy(String event)`
Get the function to run to determine the next subflow to run.
`(package private) Map<String,Function<ProfileRequestContext,String>>`
`getNextFlowStrategyMap()`
Get the map of transition rules to follow.
`void`
`setNextFlow(String flowId)`
Set the next flow to run directly, instead of using a strategy map.
`void`
`setNextFlowStrategy(Function<ProfileRequestContext,String> strategy)`
Set a function to run directly instead of using a strategy map.
`void`
`setNextFlowStrategyMap(Map<String,Object> map)`
Set the map of transition rules to follow.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### nextFlowStrategyMap

@Nonnull private Map<String,Function<ProfileRequestContext,String>> nextFlowStrategyMap
A function that determines the next flow to execute.

## 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 @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 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