Package net.shibboleth.idp.authn.impl
Class PopulateMultiFactorAuthenticationContext
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.authn.AbstractAuthenticationAction
-
- net.shibboleth.idp.authn.impl.PopulateMultiFactorAuthenticationContext
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class PopulateMultiFactorAuthenticationContext extends AbstractAuthenticationAction
An action that creates and populates aMultiFactorAuthenticationContextwith the set of transition rules to use for coordinating activity, the executingAuthenticationFlowDescriptorand with any active "factors" found, if an active result from the MFA flow is present in theAuthenticationContext.If the lookup strategy supplies no transition rules to use, then the
AuthnEventIds.RESELECT_FLOWevent is signaled.- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,AuthnEventIds.RESELECT_FLOW- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
- Postcondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class).getSubcontext( MultiFactorAuthenticationContext.class) != null
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classPopulateMultiFactorAuthenticationContext.DefaultResultLookupStrategyDefault strategy function to extract embeddedAuthenticationResults from inside theAuthenticationResultPrincipalcollection of an activeAuthenticationResultof the currently executing flow.
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,Collection<AuthenticationResult>>activeResultLookupStrategyLookup strategy for active "factors" that may already be usable.private org.slf4j.LoggerlogClass logger.private Function<ProfileRequestContext,MultiFactorAuthenticationContext>multiFactorContextCreationStrategyLookup/creation function for the context to populate.private Function<ProfileRequestContext,Map<String,MultiFactorAuthenticationTransition>>transitionMapLookupStrategyLookup strategy for obtaining the map of transition rules to use.
-
Constructor Summary
Constructors Constructor Description PopulateMultiFactorAuthenticationContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)voidsetActiveResultLookupStrategy(Function<ProfileRequestContext,Collection<AuthenticationResult>> strategy)Set the lookup strategy for any active "factors" that may be reusable.voidsetMultiFactorContextCreationStrategy(Function<ProfileRequestContext,MultiFactorAuthenticationContext> strategy)Set the lookup/creation strategy to use for the context to populate.voidsetTransitionMapLookupStrategy(Function<ProfileRequestContext,Map<String,MultiFactorAuthenticationTransition>> strategy)Set the strategy to lookup the map of transition rules to apply.-
Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, 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, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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.
-
transitionMapLookupStrategy
@Nonnull private Function<ProfileRequestContext,Map<String,MultiFactorAuthenticationTransition>> transitionMapLookupStrategy
Lookup strategy for obtaining the map of transition rules to use.
-
multiFactorContextCreationStrategy
@Nonnull private Function<ProfileRequestContext,MultiFactorAuthenticationContext> multiFactorContextCreationStrategy
Lookup/creation function for the context to populate.
-
activeResultLookupStrategy
@Nullable private Function<ProfileRequestContext,Collection<AuthenticationResult>> activeResultLookupStrategy
Lookup strategy for active "factors" that may already be usable.
-
-
Method Detail
-
setTransitionMapLookupStrategy
public void setTransitionMapLookupStrategy(@Nonnull Function<ProfileRequestContext,Map<String,MultiFactorAuthenticationTransition>> strategy)Set the strategy to lookup the map of transition rules to apply.- Parameters:
strategy- lookup strategy
-
setMultiFactorContextCreationStrategy
public void setMultiFactorContextCreationStrategy(@Nonnull Function<ProfileRequestContext,MultiFactorAuthenticationContext> strategy)Set the lookup/creation strategy to use for the context to populate.- Parameters:
strategy- lookup/creation strategy
-
setActiveResultLookupStrategy
public void setActiveResultLookupStrategy(@Nullable Function<ProfileRequestContext,Collection<AuthenticationResult>> strategy)Set the lookup strategy for any active "factors" that may be reusable.The default strategy is to look for an active
AuthenticationResultof the flow currently being attempted, and check within it forAuthenticationResultPrincipalobjects.- Parameters:
strategy- lookup strategy
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)- Overrides:
doExecutein classAbstractAuthenticationAction
-
-