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

# Class SAMLAuthnContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.saml.saml2.profile.impl.SAMLAuthnContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

public class SAMLAuthnContext extends BaseContext
Manages state during proxied SAML authentication.

Since:
  4.0.0

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private AuthnStatement`
`authnStatement`
Authentication statement.
`private Function<String,MessageDecoder>`
`decoderFactory`
The function to use to obtain a decoder.
`private ProfileAction`
`encodeMessageAction`
Profile action to execute to produce outbound message response.
`private MessageHandler`
`outboundMessageHandler`
Outbound message handler to run prior to encoding.
`private Subject`
`subject`
Subject of assertion used to authenticate.

## Constructor Summary

Constructors
Constructor
Description
`SAMLAuthnContext(ProfileAction action, Function<String,MessageDecoder> factory)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`AuthnStatement`
`getAuthnStatement()`
Get the SAML `AuthnStatement` from the authentication.
`ProfileAction`
`getEncodeMessageAction()`
Get the message-encoding profile action.
`Function<String,MessageDecoder>`
`getMessageDecoderFactory()`
Get the factory function to obtain message decoders.
`MessageHandler`
`getOutboundMessageHandler()`
Get the outbound `MessageHandler` to run prior to encoding.
`Subject`
`getSubject()`
Get the SAML `Subject` from the authentication.
`SAMLAuthnContext`
`setAuthnStatement(AuthnStatement statement)`
Set the SAML `AuthnStatement` from the authentication.
`SAMLAuthnContext`
`setOutboundMessageHandler(MessageHandler handler)`
Set the outbound `MessageHandler` to run prior to encoding.
`SAMLAuthnContext`
`setSubject(Subject sub)`
Set the SAML `Subject` from the authentication.

### Methods inherited from class org.opensaml.messaging.context.BaseContext

`addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent`

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Field Details

### outboundMessageHandler

@Nullable private MessageHandler outboundMessageHandler
Outbound message handler to run prior to encoding.

### encodeMessageAction

@Nonnull private ProfileAction encodeMessageAction
Profile action to execute to produce outbound message response.

### decoderFactory

@Nonnull private Function<String,MessageDecoder> decoderFactory
The function to use to obtain a decoder.

### subject

@Nullable private Subject subject
Subject of assertion used to authenticate.

### authnStatement

@Nullable private AuthnStatement authnStatement
Authentication statement.

## Constructor Details

### SAMLAuthnContext

public SAMLAuthnContext(@Nonnull ProfileAction action, @Nonnull Function<String,MessageDecoder> factory)
Constructor.

Parameters:
  `action` - message-encoding profile action
  `factory` - factory function to obtain decoders

## Method Details

### getEncodeMessageAction

@Nonnull public ProfileAction getEncodeMessageAction()
Get the message-encoding profile action.

Returns:
  profile action

### getMessageDecoderFactory

@Nonnull public Function<String,MessageDecoder> getMessageDecoderFactory()
Get the factory function to obtain message decoders.

Returns:
  factory function

### getOutboundMessageHandler

@Nullable public MessageHandler getOutboundMessageHandler()
Get the outbound `MessageHandler` to run prior to encoding.

Returns:
  the outbound `MessageHandler`

### setOutboundMessageHandler

@Nonnull public SAMLAuthnContext setOutboundMessageHandler(@Nullable MessageHandler handler)
Set the outbound `MessageHandler` to run prior to encoding.

Parameters:
  `handler` - outbound `MessageHandler` to set
Returns:
  this context

### getSubject

@Nullable public Subject getSubject()
Get the SAML `Subject` from the authentication.

Returns:
  SAML `Subject`

### setSubject

@Nonnull public SAMLAuthnContext setSubject(@Nullable Subject sub)
Set the SAML `Subject` from the authentication.

Parameters:
  `sub` - the SAML `Subject`
Returns:
  this context

### getAuthnStatement

@Nullable public AuthnStatement getAuthnStatement()
Get the SAML `AuthnStatement` from the authentication.

Returns:
  SAML `AuthnStatement`

### setAuthnStatement

@Nonnull public SAMLAuthnContext setAuthnStatement(@Nullable AuthnStatement statement)
Set the SAML `AuthnStatement` from the authentication.

Parameters:
  `statement` - the SAML `AuthnStatement`
Returns:
  this context