Class OneTimeUseConditionValidator
java.lang.Object
org.opensaml.saml.saml2.assertion.impl.AbstractAssertionIDReplayValidator
org.opensaml.saml.saml2.assertion.impl.OneTimeUseConditionValidator
- All Implemented Interfaces:
ConditionValidator
@ThreadSafe
public class OneTimeUseConditionValidator
extends AbstractAssertionIDReplayValidator
implements ConditionValidator
ConditionValidator used for OneTimeUse conditions.
Supports the following ValidationContext static parameters:
-
SAML2AssertionValidationParameters.COND_ONE_TIME_USE_EXPIRES: Optional. If not supplied, defaults to the validator-wide value supplied at construction, or the default value, as retrieved viaAbstractAssertionIDReplayValidator.getReplayCacheExpires().
Supports the following ValidationContext dynamic parameters:
- None.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCache context name.private org.slf4j.LoggerLogger. -
Constructor Summary
ConstructorsConstructorDescriptionOneTimeUseConditionValidator(ReplayCache replay, Duration expires) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet the cache context used with the replay cache.protected StringGet the optional validation context param name to use for the per-validation expirationGets the element or schema type QName of the condition handled by this validator.validate(Condition condition, Assertion assertion, ValidationContext context) Validates the given condition.Methods inherited from class org.opensaml.saml.saml2.assertion.impl.AbstractAssertionIDReplayValidator
doValidate, getCacheValue, getExpires, getReplayCacheExpires
-
Field Details
-
CACHE_CONTEXT
Cache context name. -
log
@Nonnull private org.slf4j.Logger logLogger.
-
-
Constructor Details
-
OneTimeUseConditionValidator
Constructor.- Parameters:
replay- reply cache used to track which assertions have been usedexpires- time for disposal of tracked assertion from the replay cache. May be null, then defaults to 8 hours
-
-
Method Details
-
getServicedCondition
Gets the element or schema type QName of the condition handled by this validator.- Specified by:
getServicedConditionin interfaceConditionValidator- Returns:
- element or schema type QName of the statement handled by this validator
-
getCacheContext
Get the cache context used with the replay cache.- Specified by:
getCacheContextin classAbstractAssertionIDReplayValidator- Returns:
- the cache context
-
getExpirationParameterName
Description copied from class:AbstractAssertionIDReplayValidatorGet the optional validation context param name to use for the per-validation expirationThis is the name of the parameter in the supplied
ValidationContextwhich holds an optionalDurationvalue.- Specified by:
getExpirationParameterNamein classAbstractAssertionIDReplayValidator- Returns:
- param name, or null
-
validate
@Nonnull public ValidationResult validate(@Nonnull Condition condition, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException Validates the given condition.- Specified by:
validatein interfaceConditionValidator- Parameters:
condition- condition to be evaluatedassertion- assertion bearing the conditioncontext- current Assertion validation context- Returns:
- the result of the condition evaluation
- Throws:
AssertionValidationException- if there is a problem processing the validation operation
-