Class SwedishEidAttributeStatementValidator
java.lang.Object
se.swedenconnect.opensaml.saml2.assertion.validation.AbstractAttributeStatementValidator
se.swedenconnect.opensaml.sweid.saml2.validation.SwedishEidAttributeStatementValidator
- All Implemented Interfaces:
org.opensaml.saml.saml2.assertion.StatementValidator
Validator for
AttributeStatement
s.
Supports the following ValidationContext
static parameters:
REQUIRED_ATTRIBUTE_SET
: Optional. Holds aAttributeSet
that 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 aCollection
of strings holding attribute names of requested attributes.
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<String> getRequiredAttributes
(org.opensaml.saml.common.assertion.ValidationContext context) Returns the required attributes.org.opensaml.saml.common.assertion.ValidationResult
validate
(org.opensaml.saml.saml2.core.Statement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context) protected org.opensaml.saml.common.assertion.ValidationResult
validateRequiredAttributes
(List<org.opensaml.saml.saml2.core.Attribute> attributes, org.opensaml.saml.saml2.core.AttributeStatement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context) Validates that the required attributes have been received by using the optional context parameterREQUIRED_ATTRIBUTE_SET
that holds anAttributeSet
and/or the list of attribute names from the parameterREQUIRED_ATTRIBUTES
.protected org.opensaml.saml.common.assertion.ValidationResult
validateScopedAttributes
(List<org.opensaml.saml.saml2.core.Attribute> attributes, org.opensaml.saml.saml2.core.AttributeStatement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context) Validates that the issuing IdP has been authorized to issue scoped attributes.Methods inherited from class se.swedenconnect.opensaml.saml2.assertion.validation.AbstractAttributeStatementValidator
getServicedStatement
-
Field Details
-
REQUIRED_ATTRIBUTE_SET
Key for a validation context parameter. Carries aAttributeSet
holding the required attributes.- See Also:
-
REQUIRED_ATTRIBUTES
Key for a validation context parameter. Carries aCollection
of strings holding attribute names of requested attributes.- See Also:
-
SCOPED_ATTRIBUTES
Key for a validation context parameter. Carries aCollection
of strings holding the attribute names for attributes that are "scoped".- See Also:
-
-
Constructor Details
-
SwedishEidAttributeStatementValidator
public SwedishEidAttributeStatementValidator()
-
-
Method Details
-
validate
public org.opensaml.saml.common.assertion.ValidationResult validate(org.opensaml.saml.saml2.core.Statement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context) throws org.opensaml.saml.common.assertion.AssertionValidationException - Specified by:
validate
in interfaceorg.opensaml.saml.saml2.assertion.StatementValidator
- Overrides:
validate
in classAbstractAttributeStatementValidator
- Throws:
org.opensaml.saml.common.assertion.AssertionValidationException
-
validateRequiredAttributes
protected org.opensaml.saml.common.assertion.ValidationResult validateRequiredAttributes(List<org.opensaml.saml.saml2.core.Attribute> attributes, org.opensaml.saml.saml2.core.AttributeStatement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.ValidationContext context) Validates that the required attributes have been received by using the optional context parameterREQUIRED_ATTRIBUTE_SET
that holds anAttributeSet
and/or the list of attribute names from the parameterREQUIRED_ATTRIBUTES
.- Specified by:
validateRequiredAttributes
in classAbstractAttributeStatementValidator
-
getRequiredAttributes
protected Collection<String> getRequiredAttributes(org.opensaml.saml.common.assertion.ValidationContext context) Returns the required attributes.- Parameters:
context
- the validation context- Returns:
- a collection of attribute names (never
null
)
-
validateScopedAttributes
protected org.opensaml.saml.common.assertion.ValidationResult validateScopedAttributes(List<org.opensaml.saml.saml2.core.Attribute> attributes, org.opensaml.saml.saml2.core.AttributeStatement statement, org.opensaml.saml.saml2.core.Assertion assertion, org.opensaml.saml.common.assertion.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
-