Package net.shibboleth.idp.authn

# Class AbstractAuthenticationAction

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

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

Direct Known Subclasses:
  `AbstractExtractionAction`, `AbstractValidationAction`, `AddAuthnRequest`, `BaseAddAuthenticationStatementToAssertion`, `ContinueSAMLAuthentication`, `DetectIdentitySwitch`, `ExtractActiveAuthenticationResults`, `ExtractDiscoveryResponse`, `FilterFlowsByForcedAuthn`, `FilterFlowsByNonBrowserSupport`, `FinalizeAuthentication`, `FinalizeMultiFactorAuthentication`, `InitializeRequestedPrincipalContext`, `PopulateAuthenticationContext`, `PopulateMultiFactorAuthenticationContext`, `PreserveAuthenticationFlowState`, `ProcessRequestedAuthnContext`, `SelectAuthenticationFlow`, `TransitionMultiFactorAuthentication`, `UpdateSessionWithAuthenticationResult`

public abstract class AbstractAuthenticationAction extends AbstractProfileAction
A base class for authentication related actions. In addition to the work performed by `AbstractProfileAction`, this action also looks up and makes available the `AuthenticationContext`. Authentication action implementations should override `doExecute(ProfileRequestContext, AuthenticationContext)`

Event:
  `AuthnEventIds.INVALID_AUTHN_CTX`

## Field Summary

Fields
Modifier and Type
Field
Description
`private AuthenticationContext`
`authnContext`
AuthenticationContext to operate on.
`private Function<ProfileRequestContext,AuthenticationContext>`
`authnCtxLookupStrategy`
Strategy used to extract, and create if necessary, the `AuthenticationContext` from the `ProfileRequestContext`.

## Constructor Summary

Constructors
Constructor
Description
`AbstractAuthenticationAction()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected final void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)`
Performs this authentication action.
`protected final boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)`
Performs this authentication action's pre-execute step.
`private AuthenticationContext`
`getAuthenticationContext()`
null safe getter.
`void`
`setAuthenticationContextLookupStrategy(Function<ProfileRequestContext,AuthenticationContext> strategy)`
Set the context lookup strategy.

### 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

### authnCtxLookupStrategy

@Nonnull private Function<ProfileRequestContext,AuthenticationContext> authnCtxLookupStrategy
Strategy used to extract, and create if necessary, the `AuthenticationContext` from the `ProfileRequestContext`.

### authnContext

@NonnullBeforeExec private AuthenticationContext authnContext
AuthenticationContext to operate on.

## Constructor Details

### AbstractAuthenticationAction

public AbstractAuthenticationAction()
Constructor.

## Method Details

### setAuthenticationContextLookupStrategy

public void setAuthenticationContextLookupStrategy(@Nonnull Function<ProfileRequestContext,AuthenticationContext> strategy)
Set the context lookup strategy.

Parameters:
  `strategy` - lookup strategy function for `AuthenticationContext`.

### getAuthenticationContext

@Nonnull private AuthenticationContext getAuthenticationContext()
null safe getter.

Returns:
  Returns the authnContext.

### doPreExecute

protected final boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected final void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
Performs this authentication action's pre-execute step. Default implementation just returns true.

Parameters:
  `profileRequestContext` - the current IdP profile request context
  `authenticationContext` - the current authentication context
Returns:
  true iff execution should continue

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
Performs this authentication action. Default implementation throws an exception.

Parameters:
  `profileRequestContext` - the current IdP profile request context
  `authenticationContext` - the current authentication context