public class SelectAuthenticationFlow extends AbstractAuthenticationAction
This is the heart of the authentication processing sequence, and runs after the
AuthenticationContext has been fully populated. It uses the potential flows,
the RequestedPrincipalContext (if any), and the active results, to decide how
to proceed.
Normal processing behavior can be circumvented if AuthenticationContext.getSignaledFlowId()
is set, which causes an active result from that flow to be reused, or that flow to be invoked, if at
all possible, subject to the usual predicates and requested principal constraints noted below.
Otherwise, if there is no RequestedPrincipalContext, then an active result will be
reused, unless the request requires forced authentication. If not possible, then a potential
flow will be selected and its ID returned as the result of the action.
If there are requested principals, then the results or flows chosen must "match" the
request information according to the PrincipalEvalPredicateFactoryRegistry
attached to the context. The "favorSSO" option determines whether to select a flow specifically
in the order specified by the RequestedPrincipalContext, or to favor an active but matching result
over a new flow. Forced authentication trumps the use of any active result.
EventIds.PROCEED_EVENT_ID (reuse of a result, i.e., SSO), AuthnEventIds.NO_PASSIVE, AuthnEventIds.NO_POTENTIAL_FLOW, AuthnEventIds.REQUEST_UNSUPPORTED, Selected flow ID to executeProfileRequestContext.getSubcontext(AuthenticationContext.class) != null, The content of
AuthenticationContext.getPotentialFlows() are assumed to be acceptable
with respect to passive and forced authentication requirements, etc.AuthenticationContext.getAuthenticationResult() will return
that result. Otherwise, AuthenticationContext.getAttemptedFlow() will return the flow
selected for execution and returned as an event.| Modifier and Type | Field and Description |
|---|---|
private boolean |
favorSSO
Whether SSO trumps explicit relying party flow preference.
|
private org.slf4j.Logger |
log
Class logger.
|
private PreferredPrincipalContext |
preferredPrincipalCtx
A subordinate PreferredPrincipalContext, if any.
|
private RequestedPrincipalContext |
requestedPrincipalCtx
A subordinate RequestedPrincipalContext, if any.
|
| Constructor and Description |
|---|
SelectAuthenticationFlow() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
private void |
doSelectNoRequestedPrincipals(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext)
Executes the selection process in the absence of specific requested principals.
|
private void |
doSelectRequestedPrincipals(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext)
Executes the selection process in the presence of specific requested Principals, requiring
evaluation of potential flows and results for Principal-compatibility with request.
|
private void |
doSelectSignaledFlow(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext)
Executes the selection process in the presence of an explicit flow signal.
|
boolean |
getFavorSSO()
Get whether SSO should trump explicit relying party requirements preference.
|
private AuthenticationFlowDescriptor |
getUnattemptedInactiveFlow(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext)
Return the first inactive potential flow not found in the intermediate flows collection that applies
to the request.
|
private void |
selectActiveResult(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext,
AuthenticationResult result)
Selects an active result and completes processing.
|
private void |
selectInactiveFlow(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext,
AuthenticationFlowDescriptor descriptor)
Selects an inactive flow and completes processing.
|
private void |
selectRequestedFlow(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext,
Map<String,AuthenticationResult> activeResults)
Selects a flow or an active result in the presence of specific requested Principals and completes processing.
|
private void |
selectRequestedInactiveFlow(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext)
Selects an inactive flow in the presence of specific requested Principals, and completes processing.
|
void |
setFavorSSO(boolean flag)
Set whether SSO should trump explicit relying party requirements preference.
|
doExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull private final org.slf4j.Logger log
private boolean favorSSO
@Nullable private RequestedPrincipalContext requestedPrincipalCtx
@Nullable private PreferredPrincipalContext preferredPrincipalCtx
public boolean getFavorSSO()
public void setFavorSSO(boolean flag)
flag - whether SSO should trump explicit relying party requirements preferenceprotected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doPreExecute in class AbstractAuthenticationActionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationActionprivate void doSelectSignaledFlow(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextprivate void doSelectNoRequestedPrincipals(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication context@Nullable private AuthenticationFlowDescriptor getUnattemptedInactiveFlow(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
profileRequestContext - the current profile request contextauthenticationContext - the current authentication contextprivate void selectInactiveFlow(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nonnull AuthenticationFlowDescriptor descriptor)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextdescriptor - the flow to selectprivate void selectActiveResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nonnull AuthenticationResult result)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextresult - the result to reuseprivate void doSelectRequestedPrincipals(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextprivate void selectRequestedInactiveFlow(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextprivate void selectRequestedFlow(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nonnull@NonnullElements Map<String,AuthenticationResult> activeResults)
profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextactiveResults - active results that may be reusedCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.