Package org.opensaml.saml.common.binding.security.impl

# Class CheckAndRecordServerTLSEntityAuthenticationtHandler

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.saml.common.binding.security.impl.CheckAndRecordServerTLSEntityAuthenticationtHandler

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `MessageHandler`

public class CheckAndRecordServerTLSEntityAuthenticationtHandler extends AbstractMessageHandler
Handler implementation that checks and records the result of `HttpClient` server TLS authentication as stored in the @link `HttpClientContext` resolved via strategy function.

If server TLS was performed and successful, store a positive authentication result in the configured `AbstractAuthenticatableSAMLEntityContext`. If the entity context's entityID is not already populated, and the appropriate entityID strategy function is configured, also attempt to resolve the authenticated entityID and if successful populate the entity context.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`CheckAndRecordServerTLSEntityAuthenticationtHandler.DefaultHttpClientContextLookup`
The default `HttpClientContext` strategy function, which resolves from the `HttpClientRequestContext` of the outbound `MessageContext` of the parent `InOutOperationContext`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Class<? extends AbstractAuthenticatableSAMLEntityContext>`
`entityContextClass`
The actual context class holding the authenticatable SAML entity.
`private ContextDataLookupFunction<MessageContext,String>`
`entityIDLookup`
The strategy function for resolving the authenticated entityID.
`private ContextDataLookupFunction<MessageContext,org.apache.hc.client5.http.protocol.HttpClientContext>`
`httpClientContextLookup`
The strategy function for resolving the `to evaluate`.
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`CheckAndRecordServerTLSEntityAuthenticationtHandler()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInvoke(MessageContext messageContext)`
Performs the handler logic.
`void`
`setEntityContextClass(Class<? extends AbstractAuthenticatableSAMLEntityContext> clazz)`
Set the class type holding the authenticatable SAML entity data.
`void`
`setEntityIDLookup(ContextDataLookupFunction<MessageContext,String> strategy)`
Set the strategy function for resolving the authenticated entityID.
`void`
`setHttpClientContextLookup(ContextDataLookupFunction<MessageContext,org.apache.hc.client5.http.protocol.HttpClientContext> strategy)`
Set the strategy function for resolving the `to evaluate`.

### Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler

`doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationCondition`

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

### log

@Nonnull private org.slf4j.Logger log
Logger.

### httpClientContextLookup

@Nonnull private ContextDataLookupFunction<MessageContext,org.apache.hc.client5.http.protocol.HttpClientContext> httpClientContextLookup
The strategy function for resolving the `to evaluate`.

### entityIDLookup

@Nullable private ContextDataLookupFunction<MessageContext,String> entityIDLookup
The strategy function for resolving the authenticated entityID.

### entityContextClass

@Nonnull private Class<? extends AbstractAuthenticatableSAMLEntityContext> entityContextClass
The actual context class holding the authenticatable SAML entity.

## Constructor Details

### CheckAndRecordServerTLSEntityAuthenticationtHandler

public CheckAndRecordServerTLSEntityAuthenticationtHandler()
Constructor.

## Method Details

### setHttpClientContextLookup

public void setHttpClientContextLookup(@Nonnull ContextDataLookupFunction<MessageContext,org.apache.hc.client5.http.protocol.HttpClientContext> strategy)
Set the strategy function for resolving the `to evaluate`.

Parameters:
  `strategy` - the new strategy function

### setEntityContextClass

public void setEntityContextClass(@Nonnull Class<? extends AbstractAuthenticatableSAMLEntityContext> clazz)
Set the class type holding the authenticatable SAML entity data.

Defaults to: `SAMLPeerEntityContext`.

Parameters:
  `clazz` - the entity context class type

### setEntityIDLookup

public void setEntityIDLookup(@Nullable ContextDataLookupFunction<MessageContext,String> strategy)
Set the strategy function for resolving the authenticated entityID.

Parameters:
  `strategy` - the new strategy function, or null

### doInvoke

protected void doInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException
Performs the handler logic.

Specified by:
  `doInvoke` in class `AbstractMessageHandler`
Parameters:
  `messageContext` - the message context on which to invoke the handler
Throws:
  `MessageHandlerException` - if there is an error invoking the handler on the message context