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:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.profile.action.ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class PopulateAuthenticationContext extends net.shibboleth.idp.authn.AbstractAuthenticationActionAn action that populates anAuthenticationContextwith theAuthenticationFlowDescriptorobjects configured into the IdP, potential flows filtered by flow IDs from a lookup function.If a
RequestedPrincipalContextchild is found, then optionally a customizedPrincipalEvalPredicateFactoryRegistrywill be installed into it.The flow IDs used for filtering must omit the
AuthenticationFlowDescriptor.FLOW_ID_PREFIXprefix.- 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<org.opensaml.profile.context.ProfileRequestContext,Collection<String>>activeFlowsLookupStrategyLookup function for the flow IDs to activate from within the available set.private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor>availableFlowsAll of the known flows in the system.private net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistryevalRegistryThe registry of predicate factories for custom principal evaluation.private Function<org.opensaml.profile.context.ProfileRequestContext,String>fixedEventLookupStrategyOptional lookup strategy for triggering credential validators to return a fixed event for testing.private org.slf4j.LoggerlogClass logger.private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor>potentialFlowsThe flows to make available for possible use.
-
Constructor Summary
Constructors Constructor Description PopulateAuthenticationContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistrygetPrincipalPredicateFactoryEvalRegistry()Get the registry of predicate factories for custom principal evaluation.voidsetActiveFlowsLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,Collection<String>> strategy)Set the lookup strategy to use for the authentication flows to activate.voidsetAvailableFlows(Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)Set the flows known to the system.voidsetFixedEventLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)Set optional lookup strategy to return a fixed event to return from credential validation to exercise error and warning logic.voidsetPotentialFlows(Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)Set the flows to make available for use (a subset of the available ones).voidsetPrincipalEvalPredicateFactoryRegistry(net.shibboleth.idp.authn.principal.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, 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
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
availableFlows
@Nonnull @NonnullElements private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> availableFlows
All of the known flows in the system.
-
potentialFlows
@Nonnull @NonnullElements private Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> potentialFlows
The flows to make available for possible use.
-
activeFlowsLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,Collection<String>> activeFlowsLookupStrategy
Lookup function for the flow IDs to activate from within the available set.
-
evalRegistry
@Nullable private net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry evalRegistry
The registry of predicate factories for custom principal evaluation.
-
-
Method Detail
-
setAvailableFlows
public void setAvailableFlows(@Nonnull @NonnullElements Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)Set the flows known to the system.- Parameters:
flows- the flows known to the system
-
setPotentialFlows
public void setPotentialFlows(@Nonnull @NonnullElements Collection<net.shibboleth.idp.authn.AuthenticationFlowDescriptor> flows)Set the flows to make available for use (a subset of the available ones).- Parameters:
flows- the flows to make available for use- Since:
- 3.3.0
-
setActiveFlowsLookupStrategy
public void setActiveFlowsLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext,Collection<String>> strategy)Set the lookup strategy to use for the authentication flows to activate.- Parameters:
strategy- lookup strategy
-
getPrincipalPredicateFactoryEvalRegistry
@Nonnull public net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry getPrincipalPredicateFactoryEvalRegistry()
Get the registry of predicate factories for custom principal evaluation.- Returns:
- predicate factory registry
-
setPrincipalEvalPredicateFactoryRegistry
public void setPrincipalEvalPredicateFactoryRegistry(@Nonnull net.shibboleth.idp.authn.principal.PrincipalEvalPredicateFactoryRegistry registry)Set the registry of predicate factories for custom principal evaluation.- Parameters:
registry- predicate factory registry
-
setFixedEventLookupStrategy
public void setFixedEventLookupStrategy(@Nullable Function<org.opensaml.profile.context.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 org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)- Overrides:
doExecutein classnet.shibboleth.idp.authn.AbstractAuthenticationAction
-
-