Package net.shibboleth.idp.authn.context

# Class AuthenticationWarningContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.AuthenticationWarningContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

public final class AuthenticationWarningContext extends BaseContext
A context that holds information about authentication warnings.

The login process is particularly prone to requiring detailed warning information to provide appropriate user feedback and auditing, and this context tracks warnings that occur and preserves detailed information about the kind of warnings encountered in multi-part authentication flows.

Parent:
  `AuthenticationContext`
Added:
  After a warning is generated during authentication

## 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 Collection<String>`
`classifiedWarnings`
Warning conditions detected through classified warning messages.

## Constructor Summary

Constructors
Constructor
Description
`AuthenticationWarningContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`AuthenticationWarningContext`
`addClassifiedWarning(String warning)`
Adds a classified warning to the context, ensuring that it will be returned from `getLastClassifiedWarning()` until another is added.
`Collection<String>`
`getClassifiedWarnings()`
Get a mutable collection of warning "tokens" associated with the context.
`String`
`getLastClassifiedWarning()`
Gets the last classified warning added, or null if none.
`boolean`
`isClassifiedWarning(String warning)`
Check for the presence of a particular warning condition in the context.

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

### classifiedWarnings

@Nonnull private Collection<String> classifiedWarnings
Warning conditions detected through classified warning messages.

## Constructor Details

### AuthenticationWarningContext

public AuthenticationWarningContext()
Constructor.

## Method Details

### getClassifiedWarnings

@Nonnull @Live public Collection<String> getClassifiedWarnings()
Get a mutable collection of warning "tokens" associated with the context.

Returns:
  mutable collection of warning strings

### isClassifiedWarning

public boolean isClassifiedWarning(@Nonnull @NotEmpty String warning)
Check for the presence of a particular warning condition in the context.

Parameters:
  `warning` - the condition to check for
Returns:
  true if the context contains the warning condition specified

### addClassifiedWarning

@Nonnull public AuthenticationWarningContext addClassifiedWarning(@Nonnull @NotEmpty String warning)
Adds a classified warning to the context, ensuring that it will be returned from `getLastClassifiedWarning()` until another is added.

Parameters:
  `warning` - warning to add
Returns:
  this context
Since:
  5.0.0

### getLastClassifiedWarning

@Nullable public String getLastClassifiedWarning()
Gets the last classified warning added, or null if none.

Returns:
  last warning added or null
Since:
  5.0.0