Package net.shibboleth.idp.authn.impl

# Class PopulateAuthenticationContext

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.PopulateAuthenticationContext

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class PopulateAuthenticationContext extends AbstractAuthenticationAction
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

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,Collection<String>>`
`activeFlowsLookupStrategy`
Lookup function for the flow IDs to activate from within the available set.
`private Collection<AuthenticationFlowDescriptor>`
`availableFlows`
All of the known flows in the system.
`private PrincipalEvalPredicateFactoryRegistry`
`evalRegistry`
The registry of predicate factories for custom principal evaluation.
`private Function<ProfileRequestContext,String>`
`fixedEventLookupStrategy`
Optional lookup strategy for triggering credential validators to return a fixed event for testing.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,Collection<AuthenticationFlowDescriptor>>`
`potentialFlowsLookupStrategy`
Lookup function for the flows to make available for possible use.

## Constructor Summary

Constructors
Constructor
Description
`PopulateAuthenticationContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)`
Performs this authentication action.
`PrincipalEvalPredicateFactoryRegistry`
`getPrincipalPredicateFactoryEvalRegistry()`
Get the registry of predicate factories for custom principal evaluation.
`void`
`setActiveFlowsLookupStrategy(Function<ProfileRequestContext,Collection<String>> strategy)`
Set the lookup strategy to use for the authentication flows to activate.
`void`
`setAvailableFlows(Collection<AuthenticationFlowDescriptor> flows)`
Set the flows known to the system.
`void`
`setFixedEventLookupStrategy(Function<ProfileRequestContext,String> strategy)`
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`
`setPrincipalEvalPredicateFactoryRegistry(PrincipalEvalPredicateFactoryRegistry registry)`
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, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### availableFlows

@Nonnull private Collection<AuthenticationFlowDescriptor> availableFlows
All of the known flows in the system.

### potentialFlowsLookupStrategy

@Nonnull private Function<ProfileRequestContext,Collection<AuthenticationFlowDescriptor>> potentialFlowsLookupStrategy
Lookup function for the flows to make available for possible use.

### activeFlowsLookupStrategy

@Nonnull private Function<ProfileRequestContext,Collection<String>> activeFlowsLookupStrategy
Lookup function for the flow IDs to activate from within the available set.

### evalRegistry

@Nullable private PrincipalEvalPredicateFactoryRegistry evalRegistry
The registry of predicate factories for custom principal evaluation.

### fixedEventLookupStrategy

@Nullable private Function<ProfileRequestContext,String> 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 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

@Nullable public PrincipalEvalPredicateFactoryRegistry 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

public void setFixedEventLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
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 class `AbstractAuthenticationAction`
Parameters:
  `profileRequestContext` - the current IdP profile request context
  `authenticationContext` - the current authentication context