Package net.shibboleth.idp.authn.impl

# Class FinalizeMultiFactorAuthentication.DefaultResultMergingStrategy

java.lang.Object
net.shibboleth.idp.authn.impl.FinalizeMultiFactorAuthentication.DefaultResultMergingStrategy

All Implemented Interfaces:
  `Function<ProfileRequestContext,AuthenticationResult>`

Enclosing class:
  FinalizeMultiFactorAuthentication

public static class FinalizeMultiFactorAuthentication.DefaultResultMergingStrategy extends Object implements Function<ProfileRequestContext,AuthenticationResult>
Default merging strategy to combine individual `AuthenticationResult` objects into a single result.

The default strategy searches for a `MultiFactorAuthenticationContext` child of an `AuthenticationContext` child of the input context, and combines all of the `Subject` content from `MultiFactorAuthenticationContext.getActiveResults()` into a single result.

It assigns the flow ID based on `AuthenticationContext.getAttemptedFlow()`, and also preserves the original result objects in wrapper principals within the new result.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`latest`
Whether to set the authentication time to that of the latest or earliest result.

## Constructor Summary

Constructors
Constructor
Description
`DefaultResultMergingStrategy()`

## Method Summary

Modifier and Type
Method
Description
`AuthenticationResult`
`apply(ProfileRequestContext input)`
`void`
`setUseLatestTimestamp(boolean flag)`
Sets whether the final result's timestamp should be based on the latest constituent result.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### latest

private boolean latest
Whether to set the authentication time to that of the latest or earliest result.

## Constructor Details

### DefaultResultMergingStrategy

public DefaultResultMergingStrategy()

## Method Details

### setUseLatestTimestamp

public void setUseLatestTimestamp(boolean flag)
Sets whether the final result's timestamp should be based on the latest constituent result.

Defaults to false, meaning to use the earliest result's timestamp.

Parameters:
  `flag` - flag to set

### apply

@Nullable public AuthenticationResult apply(@Nullable ProfileRequestContext input)

Specified by:
  `apply` in interface `Function<ProfileRequestContext,AuthenticationResult>`