Package net.shibboleth.idp.authn.impl
Class PopulateAuthenticationContext
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.PopulateAuthenticationContext
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,ProfileAction
,Aware
,MessageSource
,MessageSourceAware
,Action
An action that populates an
AuthenticationContext
with the AuthenticationFlowDescriptor
objects configured into the IdP, potential flows filtered by flow IDs from a lookup function.
If a RequestedPrincipalContext
child is found, then optionally a customized
PrincipalEvalPredicateFactoryRegistry
will be installed into it.
The flow IDs used for filtering must omit the AuthenticationFlowDescriptor.FLOW_ID_PREFIX
prefix.
- Event:
EventIds.PROCEED_EVENT_ID
- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null
- Postcondition:
- The AuthenticationContext is modified as above.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,
Collection<String>> Lookup function for the flow IDs to activate from within the available set.private Collection<AuthenticationFlowDescriptor>
All of the known flows in the system.The registry of predicate factories for custom principal evaluation.private Function<ProfileRequestContext,
String> Optional lookup strategy for triggering credential validators to return a fixed event for testing.private final org.slf4j.Logger
Class logger.Lookup function for the flows to make available for possible use. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Performs this authentication action.Get the registry of predicate factories for custom principal evaluation.void
Set the lookup strategy to use for the authentication flows to activate.void
Set the flows known to the system.void
Set optional lookup strategy to return a fixed event to return from credential validation to exercise error and warning logic.void
setPotentialFlowsLookupStrategy
(Function<ProfileRequestContext, Collection<AuthenticationFlowDescriptor>> strategy) Set the lookup strategy for the flows to make available for use (a subset of the available ones).void
Set the registry of predicate factories for custom principal evaluation.Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, doPreExecute, setAuthenticationContextLookupStrategy
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, 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, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
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 Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
availableFlows
All of the known flows in the system. -
potentialFlowsLookupStrategy
@Nonnull private Function<ProfileRequestContext,Collection<AuthenticationFlowDescriptor>> potentialFlowsLookupStrategyLookup function for the flows to make available for possible use. -
activeFlowsLookupStrategy
Lookup function for the flow IDs to activate from within the available set. -
evalRegistry
The registry of predicate factories for custom principal evaluation. -
fixedEventLookupStrategy
Optional lookup strategy for triggering credential validators to return a fixed event for testing.
-
-
Constructor Details
-
PopulateAuthenticationContext
public PopulateAuthenticationContext()Constructor.
-
-
Method Details
-
setAvailableFlows
public void setAvailableFlows(@Nonnull @NonnullElements Collection<AuthenticationFlowDescriptor> flows) Set the flows known to the system.- Parameters:
flows
- the flows known to the system
-
setPotentialFlowsLookupStrategy
public void setPotentialFlowsLookupStrategy(@Nonnull Function<ProfileRequestContext, Collection<AuthenticationFlowDescriptor>> strategy) Set the lookup strategy for the flows to make available for use (a subset of the available ones).- Parameters:
strategy
- lookup strategy- Since:
- 4.2.0
-
setActiveFlowsLookupStrategy
public void setActiveFlowsLookupStrategy(@Nonnull Function<ProfileRequestContext, Collection<String>> strategy) Set the lookup strategy to use for the authentication flows to activate.- Parameters:
strategy
- lookup strategy
-
getPrincipalPredicateFactoryEvalRegistry
Get the registry of predicate factories for custom principal evaluation.- Returns:
- predicate factory registry
-
setPrincipalEvalPredicateFactoryRegistry
public void setPrincipalEvalPredicateFactoryRegistry(@Nonnull PrincipalEvalPredicateFactoryRegistry registry) Set the registry of predicate factories for custom principal evaluation.- Parameters:
registry
- predicate factory registry
-
setFixedEventLookupStrategy
Set optional lookup strategy to return a fixed event to return from credential validation to exercise error and warning logic.- Parameters:
strategy
- lookup strategy- Since:
- 3.4.0
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) Performs this authentication action. Default implementation throws an exception.- Overrides:
doExecute
in classAbstractAuthenticationAction
- Parameters:
profileRequestContext
- the current IdP profile request contextauthenticationContext
- the current authentication context
-