Package org.opensaml.saml.saml2.assertion.impl

# Class AuthnStatementValidator

java.lang.Object
org.opensaml.saml.saml2.assertion.impl.AuthnStatementValidator

All Implemented Interfaces:
  `StatementValidator`

public class AuthnStatementValidator extends Object implements StatementValidator
`StatementValidator` implementation for `AuthnStatement` conditions.

Supports the following `ValidationContext` static parameters:

- `SAML2AssertionValidationParameters.STMT_AUTHN_CHECK_ADDRESS`: Optional.
- `SAML2AssertionValidationParameters.STMT_AUTHN_VALID_ADDRESSES`: Required if `SAML2AssertionValidationParameters.STMT_AUTHN_CHECK_ADDRESS` is true or omitted, otherwise optional.
- `SAML2AssertionValidationParameters.STMT_AUTHN_MAX_TIME`: Optional.

Supports the following `ValidationContext` dynamic parameters:

- None.

## Field Summary

Fields
Modifier and Type
Field
Description
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`AuthnStatementValidator()`

## Method Summary

Modifier and Type
Method
Description
`QName`
`getServicedStatement()`
Gets the element or schema type QName of the statement handled by this validator.
`ValidationResult`
`validate(Statement statement, Assertion assertion, ValidationContext context)`
Validates the given statement.
`protected ValidationResult`
`validateAuthnContext(AuthnStatement authnStatement, Assertion assertion, ValidationContext context)`
Validate the `AuthnContext`.
`protected ValidationResult`
`validateAuthnInstant(AuthnStatement authnStatement, Assertion assertion, ValidationContext context)`
Validate the authnInstant attribute of the `AuthnStatement`.
`protected ValidationResult`
`validateSubjectLocality(AuthnStatement authnStatement, Assertion assertion, ValidationContext context)`
Validate the `SubjectLocality`.

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

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

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Logger.

## Constructor Details

### AuthnStatementValidator

public AuthnStatementValidator()

## Method Details

### getServicedStatement

@Nonnull public QName getServicedStatement()
Gets the element or schema type QName of the statement handled by this validator.

Specified by:
  `getServicedStatement` in interface `StatementValidator`
Returns:
  element or schema type QName of the statement handled by this validator

### validate

@Nonnull public ValidationResult validate(@Nonnull Statement statement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException
Validates the given statement.

Specified by:
  `validate` in interface `StatementValidator`
Parameters:
  `statement` - statement to be validated
  `assertion` - assertion bearing the statement
  `context` - current Assertion validation context
Returns:
  the validation result
Throws:
  `AssertionValidationException` - if there is a problem processing the validation operation

### validateAuthnInstant

@Nonnull protected ValidationResult validateAuthnInstant(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException
Validate the authnInstant attribute of the `AuthnStatement`.

Parameters:
  `authnStatement` - the current statement being validated
  `assertion` - the current assertion being evaluated
  `context` - the current validation context
Returns:
  the validation result
Throws:
  `AssertionValidationException` - if there is a fatal error during evaluation

### validateSubjectLocality

@Nonnull protected ValidationResult validateSubjectLocality(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException
Validate the `SubjectLocality`.

Parameters:
  `authnStatement` - the current statement being validated
  `assertion` - the current assertion being evaluated
  `context` - the current validation context
Returns:
  the validation result
Throws:
  `AssertionValidationException` - if there is a fatal error during evaluation

### validateAuthnContext

@Nonnull protected ValidationResult validateAuthnContext(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException
Validate the `AuthnContext`.

The default implementation is a no-op and always valid. Subclasses may override.

Parameters:
  `authnStatement` - the current statement being validated
  `assertion` - the current assertion being evaluated
  `context` - the current validation context
Returns:
  the validation result
Throws:
  `AssertionValidationException` - if there is a fatal error during evaluation