Package net.shibboleth.idp.authn.impl
Class PopulateMultiFactorAuthenticationContext
java.lang.Object
net.shibboleth.shared.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
An action that creates and populates a
MultiFactorAuthenticationContext with the set of
transition rules to use for coordinating activity, the executing AuthenticationFlowDescriptor
and with any active "factors" found, if an active result from the MFA flow is present in the
AuthenticationContext.
If the lookup strategy supplies no transition rules to use, then the AuthnEventIds.RESELECT_FLOW
event 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 ClassesModifier and TypeClassDescriptionprivate classDefault strategy function to extract embeddedAuthenticationResults from inside theAuthenticationResultPrincipalcollection of an activeAuthenticationResultof the currently executing flow. -
Field Summary
FieldsModifier and TypeFieldDescriptionLookup strategy for active "factors" that may already be usable.private final org.slf4j.LoggerClass logger.Lookup/creation function for the context to populate.Lookup strategy for obtaining the map of transition rules to use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Performs this authentication action.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, setAuthenticationContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
transitionMapLookupStrategy
@Nonnull private Function<ProfileRequestContext,Map<String, transitionMapLookupStrategyMultiFactorAuthenticationTransition>> Lookup strategy for obtaining the map of transition rules to use. -
multiFactorContextCreationStrategy
@Nonnull private Function<ProfileRequestContext,MultiFactorAuthenticationContext> multiFactorContextCreationStrategyLookup/creation function for the context to populate. -
activeResultLookupStrategy
@Nullable private Function<ProfileRequestContext,Collection<AuthenticationResult>> activeResultLookupStrategyLookup strategy for active "factors" that may already be usable.
-
-
Constructor Details
-
PopulateMultiFactorAuthenticationContext
PopulateMultiFactorAuthenticationContext()Constructor.
-
-
Method Details
-
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) Performs this authentication action. Default implementation throws an exception.- Overrides:
doExecutein classAbstractAuthenticationAction- Parameters:
profileRequestContext- the current IdP profile request contextauthenticationContext- the current authentication context
-