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>>nextFlowStrategyMapA function that determines the next flow to execute.
-
Constructor Summary
Constructors Constructor Description MultiFactorAuthenticationTransition()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.voidsetNextFlow(String flowId)Set the next flow to run directly, instead of using a strategy map.voidsetNextFlowStrategy(Function<ProfileRequestContext,String> strategy)Set a function to run directly instead of using a strategy map.voidsetNextFlowStrategyMap(Map<String,Object> map)Set the map of transition rules to follow.
-
-
-
Field Detail
-
nextFlowStrategyMap
@Nonnull @NonnullElements private Map<String,Function<ProfileRequestContext,String>> nextFlowStrategyMap
A function that determines the next flow to execute.
-
-
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
-
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
Stringidentifying the flow ID to run, or aFunction<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
-
-