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 ifSAML2AssertionValidationParameters.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 theAuthnContext
.protected ValidationResult
validateAuthnInstant(AuthnStatement authnStatement, Assertion assertion, ValidationContext context)
Validate the authnInstant attribute of theAuthnStatement
.protected ValidationResult
validateSubjectLocality(AuthnStatement authnStatement, Assertion assertion, ValidationContext context)
Validate theSubjectLocality
.
-
Field Details
-
log
private org.slf4j.Logger logLogger.
-
-
Constructor Details
-
AuthnStatementValidator
public AuthnStatementValidator()
-
-
Method Details
-
getServicedStatement
Gets the element or schema type QName of the statement handled by this validator.- Specified by:
getServicedStatement
in interfaceStatementValidator
- Returns:
- element or schema type QName of the statement handled by this validator
-
validate
public ValidationResult validate(@Nonnull Statement statement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationExceptionValidates the given statement.- Specified by:
validate
in interfaceStatementValidator
- Parameters:
statement
- statement to be validatedassertion
- assertion bearing the statementcontext
- current Assertion validation context- Returns:
- the validation result
- Throws:
AssertionValidationException
- if there is a problem processing the validation operation
-
validateAuthnInstant
protected ValidationResult validateAuthnInstant(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationExceptionValidate the authnInstant attribute of theAuthnStatement
.- Parameters:
authnStatement
- the current statement being validatedassertion
- the current assertion being evaluatedcontext
- the current validation context- Returns:
- the validation result
- Throws:
AssertionValidationException
- if there is a fatal error during evaluation
-
validateSubjectLocality
protected ValidationResult validateSubjectLocality(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationExceptionValidate theSubjectLocality
.- Parameters:
authnStatement
- the current statement being validatedassertion
- the current assertion being evaluatedcontext
- the current validation context- Returns:
- the validation result
- Throws:
AssertionValidationException
- if there is a fatal error during evaluation
-
validateAuthnContext
protected ValidationResult validateAuthnContext(@Nonnull AuthnStatement authnStatement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationExceptionValidate theAuthnContext
.The default implementation is a no-op and always valid. Subclasses may override.
- Parameters:
authnStatement
- the current statement being validatedassertion
- the current assertion being evaluatedcontext
- the current validation context- Returns:
- the validation result
- Throws:
AssertionValidationException
- if there is a fatal error during evaluation
-