Class SwedishEidAttributeStatementValidator
java.lang.Object
se.swedenconnect.opensaml.saml2.assertion.validation.AbstractAttributeStatementValidator
se.swedenconnect.opensaml.sweid.saml2.validation.SwedishEidAttributeStatementValidator
- All Implemented Interfaces:
StatementValidator
Validator for
AttributeStatements.
Supports the following ValidationContext static parameters:
REQUIRED_ATTRIBUTE_SET: Optional. Holds aAttributeSetthat tells which attributes we require to find in the assertion.REQUIRED_ATTRIBUTES: Optional. Holds a collection of strings that are the attribute names that we require to find in the assertion.SCOPED_ATTRIBUTES: Optional. Carries aCollectionof strings holding the attribute names for attributes that are "scoped".
Note that the two above parameters may be combined. If no parameter for requested attributes is passed, no validation will be performed.
- Author:
- Martin Lindström (martin@idsec.se)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<String> getRequiredAttributes(ValidationContext context) Returns the required attributes.validate(Statement statement, Assertion assertion, ValidationContext context) protected ValidationResultvalidateRequiredAttributes(List<Attribute> attributes, AttributeStatement statement, Assertion assertion, ValidationContext context) Validates that the required attributes have been received by using the optional context parameterREQUIRED_ATTRIBUTE_SETthat holds anAttributeSetand/or the list of attribute names from the parameterREQUIRED_ATTRIBUTES.protected ValidationResultvalidateScopedAttributes(List<Attribute> attributes, AttributeStatement statement, Assertion assertion, ValidationContext context) Validates that the issuing IdP has been authorized to issue scoped attributes.Methods inherited from class AbstractAttributeStatementValidator
getServicedStatement
-
Field Details
-
REQUIRED_ATTRIBUTE_SET
Key for a validation context parameter. Carries aAttributeSetholding the required attributes.- See Also:
-
REQUIRED_ATTRIBUTES
Key for a validation context parameter. Carries aCollectionof strings holding attribute names of required attributes.- See Also:
-
SCOPED_ATTRIBUTES
Key for a validation context parameter. Carries aCollectionof strings holding the attribute names for attributes that are "scoped".- See Also:
-
-
Constructor Details
-
SwedishEidAttributeStatementValidator
public SwedishEidAttributeStatementValidator()
-
-
Method Details
-
validate
@Nonnull public ValidationResult validate(@Nonnull Statement statement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) throws AssertionValidationException - Specified by:
validatein interfaceStatementValidator- Overrides:
validatein classAbstractAttributeStatementValidator- Throws:
AssertionValidationException
-
validateRequiredAttributes
@Nonnull protected ValidationResult validateRequiredAttributes(@Nonnull List<Attribute> attributes, @Nonnull AttributeStatement statement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) Validates that the required attributes have been received by using the optional context parameterREQUIRED_ATTRIBUTE_SETthat holds anAttributeSetand/or the list of attribute names from the parameterREQUIRED_ATTRIBUTES.- Specified by:
validateRequiredAttributesin classAbstractAttributeStatementValidator
-
getRequiredAttributes
Returns the required attributes.- Parameters:
context- the validation context- Returns:
- a collection of attribute names (never
null)
-
validateScopedAttributes
@Nonnull protected ValidationResult validateScopedAttributes(@Nonnull List<Attribute> attributes, @Nonnull AttributeStatement statement, @Nonnull Assertion assertion, @Nonnull ValidationContext context) Validates that the issuing IdP has been authorized to issue scoped attributes.- Parameters:
attributes- a list of the attributesstatement- the statementassertion- the assertioncontext- the validation context- Returns:
- a validation result
-