Package net.shibboleth.idp.saml.profile.impl

# Class BaseAddAuthenticationStatementToAssertion

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.saml.profile.impl.BaseAddAuthenticationStatementToAssertion

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

Direct Known Subclasses:
  `AddAuthenticationStatementToAssertion`, `AddAuthnStatementToAssertion`

public abstract class BaseAddAuthenticationStatementToAssertion extends AbstractAuthenticationAction
Base class for actions that encode authentication information into a SAML 1 or SAML 2 statement.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.INVALID_MSG_CTX`, `AuthnEventIds.INVALID_AUTHN_CTX`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private class`
`BaseAddAuthenticationStatementToAssertion.RemoteAddressStrategy`
Default strategy for obtaining client address from servlet layer.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<ProfileRequestContext,String>`
`addressLookupStrategy`
Strategy used to obtain the client Address to insert.
`private AuthenticationResult`
`authenticationResult`
AuthenticationResult basis of statement.
`private IdentifierGenerationStrategy`
`idGenerator`
The generator to use.
`private Function<ProfileRequestContext,IdentifierGenerationStrategy>`
`idGeneratorLookupStrategy`
Strategy used to locate the `IdentifierGenerationStrategy` to use.
`private String`
`issuerId`
EntityID to populate as assertion issuer.
`private Function<ProfileRequestContext,String>`
`issuerLookupStrategy`
Strategy used to obtain the assertion issuer value.
`private final org.slf4j.Logger`
`log`
Class logger.
`private boolean`
`statementInOwnAssertion`
Whether the generated authentication statement should be placed in its own assertion or added to one if it exists.

## Constructor Summary

Constructors
Constructor
Description
`BaseAddAuthenticationStatementToAssertion()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)`
Performs this authentication action's pre-execute step.
`Function<ProfileRequestContext,String>`
`getAddressLookupStrategy()`
Get the strategy used to obtain the client IP address to insert into the statement.
`AuthenticationResult`
`getAuthenticationResult()`
Get the `AuthenticationResult` to encode.
`IdentifierGenerationStrategy`
`getIdGenerator()`
Get the `IdentifierGenerationStrategy` to use if an assertion must be created.
`String`
`getIssuerId()`
Get the issuer name to use if an assertion must be created.
`boolean`
`isStatementInOwnAssertion()`
Set whether the generated statement should be placed in its own assertion or added to one if it exists.
`void`
`setAddressLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the strategy used to obtain the client IP address to insert into the statement.
`void`
`setIdentifierGeneratorLookupStrategy(Function<ProfileRequestContext,IdentifierGenerationStrategy> strategy)`
Set the strategy used to locate the `IdentifierGenerationStrategy` to use.
`void`
`setIssuerLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the strategy used to locate the issuer value to use.
`void`
`setStatementInOwnAssertion(boolean inOwnAssertion)`
Set whether the generated authentication statement should be placed in its own assertion or added to one if it exists.

### Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction

`doExecute, doExecute, 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, 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.

### statementInOwnAssertion

private boolean statementInOwnAssertion
Whether the generated authentication statement should be placed in its own assertion or added to one if it exists.

### idGeneratorLookupStrategy

@Nonnull private Function<ProfileRequestContext,IdentifierGenerationStrategy> idGeneratorLookupStrategy
Strategy used to locate the `IdentifierGenerationStrategy` to use.

### issuerLookupStrategy

@Nonnull private Function<ProfileRequestContext,String> issuerLookupStrategy
Strategy used to obtain the assertion issuer value.

### addressLookupStrategy

@NonnullAfterInit private Function<ProfileRequestContext,String> addressLookupStrategy
Strategy used to obtain the client Address to insert.

### authenticationResult

@NonnullBeforeExec private AuthenticationResult authenticationResult
AuthenticationResult basis of statement.

### idGenerator

@NonnullBeforeExec private IdentifierGenerationStrategy idGenerator
The generator to use.

### issuerId

@NonnullBeforeExec private String issuerId
EntityID to populate as assertion issuer.

## Constructor Details

### BaseAddAuthenticationStatementToAssertion

public BaseAddAuthenticationStatementToAssertion()
Constructor.

## Method Details

### isStatementInOwnAssertion

public boolean isStatementInOwnAssertion()
Set whether the generated statement should be placed in its own assertion or added to one if it exists.

Returns:
  whether the generated statement should be placed in its own assertion or added to one if it exists

### setStatementInOwnAssertion

public void setStatementInOwnAssertion(boolean inOwnAssertion)
Set whether the generated authentication statement should be placed in its own assertion or added to one if it exists.

Parameters:
  `inOwnAssertion` - whether the generated authentication statement should be placed in its own assertion or added to one if it exists

### setIdentifierGeneratorLookupStrategy

public void setIdentifierGeneratorLookupStrategy(@Nonnull Function<ProfileRequestContext,IdentifierGenerationStrategy> strategy)
Set the strategy used to locate the `IdentifierGenerationStrategy` to use.

Parameters:
  `strategy` - lookup strategy

### setIssuerLookupStrategy

public void setIssuerLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set the strategy used to locate the issuer value to use.

Parameters:
  `strategy` - lookup strategy

### getAddressLookupStrategy

@NonnullAfterInit public Function<ProfileRequestContext,String> getAddressLookupStrategy()
Get the strategy used to obtain the client IP address to insert into the statement.

Returns:
  lookup strategy
Since:
  4.0.0

### setAddressLookupStrategy

public void setAddressLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set the strategy used to obtain the client IP address to insert into the statement.

Parameters:
  `strategy` - lookup strategy
Since:
  4.0.0

### getAuthenticationResult

@Nonnull public AuthenticationResult getAuthenticationResult()
Get the `AuthenticationResult` to encode.

Returns:
  the result to encode

### getIdGenerator

@Nonnull public IdentifierGenerationStrategy getIdGenerator()
Get the `IdentifierGenerationStrategy` to use if an assertion must be created.

Returns:
  the ID generation strategy

### getIssuerId

@Nonnull public String getIssuerId()
Get the issuer name to use if an assertion must be created.

Returns:
  the issuer name

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

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

Overrides:
  `doPreExecute` in class `AbstractAuthenticationAction`
Parameters:
  `profileRequestContext` - the current IdP profile request context
  `authenticationContext` - the current authentication context
Returns:
  true iff execution should continue