Class AbstractSubjectConfirmationValidator
- java.lang.Object
-
- org.opensaml.saml.saml2.assertion.impl.AbstractSubjectConfirmationValidator
-
- All Implemented Interfaces:
org.opensaml.saml.saml2.assertion.SubjectConfirmationValidator
- Direct Known Subclasses:
BearerSubjectConfirmationValidator,HolderOfKeySubjectConfirmationValidator,SenderVouchersSubjectConfirmationValidator
@ThreadSafe public abstract class AbstractSubjectConfirmationValidator extends Object implements org.opensaml.saml.saml2.assertion.SubjectConfirmationValidator
A base class forSubjectConfirmationValidatorimplementations.This class takes care of processing the
NotBefore,NotOnOrAfter,Recipient, andAddresschecks.Supports the following
ValidationContextstatic parameters:-
SAML2AssertionValidationParameters.SC_ADDRESS_REQUIRED: Optional. -
SAML2AssertionValidationParameters.SC_CHECK_ADDRESS: Optional. -
SAML2AssertionValidationParameters.SC_VALID_ADDRESSES: Required ifSAML2AssertionValidationParameters.SC_CHECK_ADDRESSis true or omitted, otherwise optional. -
SAML2AssertionValidationParameters.SC_RECIPIENT_REQUIRED: Optional. -
SAML2AssertionValidationParameters.SC_VALID_RECIPIENTS: Required. -
SAML2AssertionValidationParameters.SC_IN_RESPONSE_TO_REQUIRED: Optional. -
SAML2AssertionValidationParameters.SC_VALID_IN_RESPONSE_TO: Required. -
SAML2AssertionValidationParameters.SC_NOT_BEFORE_REQUIRED: Optional. -
SAML2AssertionValidationParameters.SC_NOT_ON_OR_AFTER_REQUIRED: Optional.
Supports the following
ValidationContextdynamic parameters:- None.
-
-
Constructor Summary
Constructors Constructor Description AbstractSubjectConfirmationValidator()Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.opensaml.saml.common.assertion.ValidationResultdoValidate(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context)Performs any further validation required for the specific confirmation method implementation.protected booleanisAddressRequired(org.opensaml.saml.common.assertion.ValidationContext context)Determine whether Address is required.protected booleanisInResponseToRequired(org.opensaml.saml.common.assertion.ValidationContext context)Determine whether InResponseTo is required.protected booleanisNotBeforeRequired(org.opensaml.saml.common.assertion.ValidationContext context)Determine whether NotBefore is required.protected booleanisNotOnOrAfterRequired(org.opensaml.saml.common.assertion.ValidationContext context)Determine whether NotOnOrAfter is required.protected booleanisRecipientRequired(org.opensaml.saml.common.assertion.ValidationContext context)Determine whether Recipient is required.org.opensaml.saml.common.assertion.ValidationResultvalidate(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context)protected org.opensaml.saml.common.assertion.ValidationResultvalidateAddress(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context, boolean required)Validates theAddresscondition of theSubjectConfirmationData, if any is present.protected org.opensaml.saml.common.assertion.ValidationResultvalidateInResponseTo(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context, boolean required)Validates theInResponseTocondition of theSubjectConfirmationData, if any is present.protected org.opensaml.saml.common.assertion.ValidationResultvalidateNotBefore(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context, boolean required)Validates theNotBeforecondition of theSubjectConfirmationData, if any is present.protected org.opensaml.saml.common.assertion.ValidationResultvalidateNotOnOrAfter(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context, boolean required)Validates theNotOnOrAftercondition of theSubjectConfirmationData, if any is present.protected org.opensaml.saml.common.assertion.ValidationResultvalidateRecipient(org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context, boolean required)Validates theRecipientcondition of theSubjectConfirmationData, if any is present.
-
-
-
Field Detail
-
log
private Logger log
Class logger.
-
-
Method Detail
-
validate
@Nonnull public org.opensaml.saml.common.assertion.ValidationResult validate(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context) throws org.opensaml.saml.common.assertion.AssertionValidationException- Specified by:
validatein interfaceorg.opensaml.saml.saml2.assertion.SubjectConfirmationValidator- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException
-
isAddressRequired
protected boolean isAddressRequired(org.opensaml.saml.common.assertion.ValidationContext context)
Determine whether Address is required.- Parameters:
context- current validation context- Returns:
- true if required, false if not
-
isRecipientRequired
protected boolean isRecipientRequired(org.opensaml.saml.common.assertion.ValidationContext context)
Determine whether Recipient is required.- Parameters:
context- current validation context- Returns:
- true if required, false if not
-
isNotBeforeRequired
protected boolean isNotBeforeRequired(org.opensaml.saml.common.assertion.ValidationContext context)
Determine whether NotBefore is required.- Parameters:
context- current validation context- Returns:
- true if required, false if not
-
isNotOnOrAfterRequired
protected boolean isNotOnOrAfterRequired(org.opensaml.saml.common.assertion.ValidationContext context)
Determine whether NotOnOrAfter is required.- Parameters:
context- current validation context- Returns:
- true if required, false if not
-
isInResponseToRequired
protected boolean isInResponseToRequired(org.opensaml.saml.common.assertion.ValidationContext context)
Determine whether InResponseTo is required.- Parameters:
context- current validation context- Returns:
- true if required, false if not
-
validateInResponseTo
protected org.opensaml.saml.common.assertion.ValidationResult validateInResponseTo(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context, boolean required) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionValidates theInResponseTocondition of theSubjectConfirmationData, if any is present.- Parameters:
confirmation- confirmation method, withSubjectConfirmationData, being validatedassertion- assertion bearing the confirmation methodcontext- current validation contextrequired- whether the InResponseTo value is required- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if there is a problem determining the validity of the NotBefore
-
validateNotBefore
@Nonnull protected org.opensaml.saml.common.assertion.ValidationResult validateNotBefore(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context, boolean required) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionValidates theNotBeforecondition of theSubjectConfirmationData, if any is present.- Parameters:
confirmation- confirmation method, withSubjectConfirmationData, being validatedassertion- assertion bearing the confirmation methodcontext- current validation contextrequired-- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if there is a problem determining the validity of the NotBefore
-
validateNotOnOrAfter
@Nonnull protected org.opensaml.saml.common.assertion.ValidationResult validateNotOnOrAfter(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context, boolean required) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionValidates theNotOnOrAftercondition of theSubjectConfirmationData, if any is present.- Parameters:
confirmation- confirmation method, withSubjectConfirmationData, being validatedassertion- assertion bearing the confirmation methodcontext- current validation contextrequired- whether the NotOnOrAfter value is required- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if there is a problem determining the validity of the NotOnOrAFter
-
validateRecipient
@Nonnull protected org.opensaml.saml.common.assertion.ValidationResult validateRecipient(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context, boolean required) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionValidates theRecipientcondition of theSubjectConfirmationData, if any is present.- Parameters:
confirmation- confirmation method being validatedassertion- assertion bearing the confirmation methodcontext- current validation contextrequired- whether the Recipient value is required- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if there is a problem determining the validity of the recipient
-
validateAddress
@Nonnull protected org.opensaml.saml.common.assertion.ValidationResult validateAddress(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context, boolean required) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionValidates theAddresscondition of theSubjectConfirmationData, if any is present.- Parameters:
confirmation- confirmation method being validatedassertion- assertion bearing the confirmation methodcontext- current validation contextrequired- whether the Address value is required- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if there is a problem determining the validity of the address
-
doValidate
@Nonnull protected abstract org.opensaml.saml.common.assertion.ValidationResult doValidate(@Nonnull org.opensaml.saml.saml2.core.SubjectConfirmation confirmation, @Nonnull org.opensaml.saml.saml2.core.Assertion assertion, @Nonnull org.opensaml.saml.common.assertion.ValidationContext context) throws org.opensaml.saml.common.assertion.AssertionValidationExceptionPerforms any further validation required for the specific confirmation method implementation.- Parameters:
confirmation- confirmation method being validatedassertion- assertion bearing the confirmation methodcontext- current validation context- Returns:
- the result of the validation evaluation
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException- thrown if further validation finds the confirmation method to be invalid
-
-