public class SAML2TestResponseValidator extends SAML2TestStatusResponseTypeValidator
#org.opensaml.saml.saml2.core.Response validator.| Modifier and Type | Field and Description |
|---|---|
String |
authnContextClassRef
Authentication context class reference.
|
org.opensaml.saml.saml2.core.Attribute |
eduPersonScopedAffiliationAttribute
Expected eduPersonScopedAffiliation attribute.
|
org.opensaml.saml.saml2.core.Attribute |
eppnAttribute
Expected eppn attribute.
|
List<org.opensaml.saml.saml2.core.Attribute> |
expectedAttributes
Expected attributes.
|
List<org.opensaml.saml.saml2.core.Attribute> |
expectedDesignatedAttributes
Expected attributes.
|
org.opensaml.saml.saml2.core.Attribute |
mailAttribute
Expected mail attribute.
|
org.opensaml.saml.saml2.core.NameID |
nameID
Expected name identifier.
|
org.opensaml.security.credential.Credential |
spCredential
SP credential.
|
String |
subjectConfirmationMethod
Expected subject confirmation method.
|
org.opensaml.saml.saml2.core.Attribute |
uidAttribute
Expected uid attribute.
|
boolean |
usedAttributeDesignators
Whether attributes were limited by designators.
|
boolean |
validateAuthnStatements
Whether authn statements should be validated.
|
boolean |
validateSubjectConfirmationData
Whether subject confirmation data should be validated.
|
destination, idpEntityID, spEntityID, statusCode, statusCodeNested, statusMessage| Constructor and Description |
|---|
SAML2TestResponseValidator()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
assertAssertion(org.opensaml.saml.saml2.core.Assertion assertion)
Assert that :
the assertion ID is not null nor empty
the assertion issue instant is not null
the assertion version is
SAMLVersion.VERSION_20
the issuer is the expected IdP entity ID
|
void |
assertAssertions(List<org.opensaml.saml.saml2.core.Assertion> assertions)
Assert that a single assertion is present.
|
void |
assertAttributeName(org.opensaml.saml.saml2.core.Attribute attribute,
String name,
String nameFormat,
String friendlyName)
Assert that the attribute name, name format, and friendly name are the supplied names.
|
void |
assertAttributes(List<org.opensaml.saml.saml2.core.Attribute> attributes)
Assert that the attributes from the response match the expected attributes.
|
void |
assertAttributeStatement(org.opensaml.saml.saml2.core.AttributeStatement attributeStatement)
Assert that the attribute statement has attributes.
|
void |
assertAttributeStatements(List<org.opensaml.saml.saml2.core.AttributeStatement> attributeStatements)
Assert that a single attribute statement is present.
|
void |
assertAttributeValue(org.opensaml.saml.saml2.core.Attribute attribute,
String attributeValue)
Assert that the attribute value is the supplied String value.
|
void |
assertAudienceRestriction(org.opensaml.saml.saml2.core.AudienceRestriction audienceRestriction)
Assert that the audience restriction has a single audience whose URI is the expected SP entity ID.
|
void |
assertAudienceRestrictions(List<org.opensaml.saml.saml2.core.AudienceRestriction> audienceRestrictions)
Assert that a single audience restriction is present.
|
void |
assertAuthnContextClassRef(org.opensaml.saml.saml2.core.AuthnContextClassRef authnContext)
Assert that the authn context class ref is
AuthnContext.IP_AUTHN_CTX. |
void |
assertAuthnStatement(org.opensaml.saml.saml2.core.AuthnStatement authnStatement)
Assert that the authn statement has an authn instant and authn context class ref.
|
void |
assertAuthnStatements(List<org.opensaml.saml.saml2.core.AuthnStatement> authnStatements)
Assert that a single authn statement is present.
|
void |
assertConditions(org.opensaml.saml.saml2.core.Conditions conditions)
Assert that the conditions has NotBefore and NotOnOrAfter attributes.
|
void |
assertNameID(org.opensaml.saml.saml2.core.NameID id)
Assert that :
the NameID is not null
the NameID value is not null
the NameID format is the expected format
the NameID value is the expected value if the format is not transient
the NameID name qualifier is the expected name qualifier
the NameID SP name qualifier is the expected SP name qualifier
|
void |
assertSubject(org.opensaml.saml.saml2.core.Subject subject)
Assert that the subject has a nameID and subject confirmations.
|
void |
assertSubjectConfirmation(org.opensaml.saml.saml2.core.SubjectConfirmation subjectConfirmation)
Assert that the subject confirmation has a confirmation method.
|
void |
assertSubjectConfirmationData(org.opensaml.saml.saml2.core.SubjectConfirmationData subjectConfirmationData)
Assert that :
the subject confirmation data address is "127.0.0.1"
the subject confirmation data NotOnOrAfter is not null
the subject confirmation data recipient is not null nor empty
|
void |
assertSubjectConfirmationMethod(org.opensaml.saml.saml2.core.SubjectConfirmation method)
Assert that the subject confirmation method is
SubjectConfirmation.METHOD_BEARER. |
void |
assertSubjectConfirmations(List<org.opensaml.saml.saml2.core.SubjectConfirmation> subjectConfirmations)
Assert that a single subject confirmation is present.
|
protected void |
buildExpectedAttributes()
Build expected attributes.
|
private org.opensaml.saml.saml2.core.Assertion |
decryptAssertion(org.opensaml.saml.saml2.core.EncryptedAssertion encrypted) |
void |
validateAttributeStatements(org.opensaml.saml.saml2.core.Assertion assertion)
Validate the assertion attribute statements.
|
void |
validateAuthnStatements(org.opensaml.saml.saml2.core.Assertion assertion)
Validate the assertion authentication statements.
|
void |
validateConditions(org.opensaml.saml.saml2.core.Assertion assertion)
Validate the assertion conditions.
|
void |
validateResponse(org.opensaml.saml.saml2.core.Response response)
Validate the response.
|
void |
validateSubject(org.opensaml.saml.saml2.core.Subject subject)
Validate the subject.
|
assertResponse, assertStatus, validateResponse@Nonnull public String authnContextClassRef
@Nullable public org.opensaml.security.credential.Credential spCredential
@Nonnull public org.opensaml.saml.saml2.core.NameID nameID
@Nonnull public String subjectConfirmationMethod
@Nonnull public boolean validateAuthnStatements
@Nonnull public boolean validateSubjectConfirmationData
public boolean usedAttributeDesignators
@Nonnull public List<org.opensaml.saml.saml2.core.Attribute> expectedAttributes
@Nonnull public List<org.opensaml.saml.saml2.core.Attribute> expectedDesignatedAttributes
@Nonnull public org.opensaml.saml.saml2.core.Attribute uidAttribute
@Nonnull public org.opensaml.saml.saml2.core.Attribute eppnAttribute
@Nonnull public org.opensaml.saml.saml2.core.Attribute mailAttribute
@Nonnull public org.opensaml.saml.saml2.core.Attribute eduPersonScopedAffiliationAttribute
protected void buildExpectedAttributes()
private org.opensaml.saml.saml2.core.Assertion decryptAssertion(org.opensaml.saml.saml2.core.EncryptedAssertion encrypted)
throws org.opensaml.xmlsec.encryption.support.DecryptionException
org.opensaml.xmlsec.encryption.support.DecryptionExceptionpublic void validateResponse(@Nullable org.opensaml.saml.saml2.core.Response response)
Calls validate methods :
validateSubject(Subject)validateConditions(Assertion)validateAuthnStatements(Assertion)validateAttributeStatements(Assertion)#assertResponse(Response)SAML2TestStatusResponseTypeValidator.assertStatus(Status)assertAssertions(List)assertAssertion(Assertion)response - the flow execution resultpublic void validateSubject(@Nullable org.opensaml.saml.saml2.core.Subject subject)
Calls assert methods :
subject - the subjectpublic void validateConditions(@Nullable org.opensaml.saml.saml2.core.Assertion assertion)
Calls assert methods :
assertion - the assertionpublic void validateAuthnStatements(@Nullable org.opensaml.saml.saml2.core.Assertion assertion)
Calls assert methods :
assertion - the assertionpublic void validateAttributeStatements(@Nullable org.opensaml.saml.saml2.core.Assertion assertion)
Calls assert methods :
assertion - the assertionpublic void assertAssertions(@Nullable List<org.opensaml.saml.saml2.core.Assertion> assertions)
assertions - the assertionspublic void assertAssertion(@Nullable org.opensaml.saml.saml2.core.Assertion assertion)
SAMLVersion.VERSION_20assertion - the assertionpublic void assertSubject(@Nullable org.opensaml.saml.saml2.core.Subject subject)
subject - the subjectpublic void assertSubjectConfirmations(@Nullable List<org.opensaml.saml.saml2.core.SubjectConfirmation> subjectConfirmations)
subjectConfirmations - the subject confirmationspublic void assertSubjectConfirmation(@Nullable org.opensaml.saml.saml2.core.SubjectConfirmation subjectConfirmation)
subjectConfirmation - the subject confirmationpublic void assertSubjectConfirmationMethod(@Nullable org.opensaml.saml.saml2.core.SubjectConfirmation method)
SubjectConfirmation.METHOD_BEARER.method - the subject confirmationpublic void assertSubjectConfirmationData(@Nullable org.opensaml.saml.saml2.core.SubjectConfirmationData subjectConfirmationData)
subjectConfirmationData - the subject confirmation datapublic void assertNameID(@Nullable org.opensaml.saml.saml2.core.NameID id)
id - the NameIDpublic void assertConditions(@Nullable org.opensaml.saml.saml2.core.Conditions conditions)
conditions - the conditionspublic void assertAudienceRestrictions(@Nullable List<org.opensaml.saml.saml2.core.AudienceRestriction> audienceRestrictions)
audienceRestrictions - the audience restrictionspublic void assertAudienceRestriction(@Nullable org.opensaml.saml.saml2.core.AudienceRestriction audienceRestriction)
audienceRestriction - the audience restrictionpublic void assertAuthnStatements(@Nullable List<org.opensaml.saml.saml2.core.AuthnStatement> authnStatements)
authnStatements - the authn statementspublic void assertAuthnStatement(@Nonnull org.opensaml.saml.saml2.core.AuthnStatement authnStatement)
authnStatement - the authn statementpublic void assertAuthnContextClassRef(@Nullable org.opensaml.saml.saml2.core.AuthnContextClassRef authnContext)
AuthnContext.IP_AUTHN_CTX.authnContext - the authn contextpublic void assertAttributeStatements(@Nullable List<org.opensaml.saml.saml2.core.AttributeStatement> attributeStatements)
attributeStatements - the attribute statementspublic void assertAttributeStatement(@Nullable org.opensaml.saml.saml2.core.AttributeStatement attributeStatement)
attributeStatement - the attribute statementpublic void assertAttributes(@Nullable List<org.opensaml.saml.saml2.core.Attribute> attributes)
attributes - the attributespublic void assertAttributeName(@Nullable org.opensaml.saml.saml2.core.Attribute attribute, @Nonnull String name, @Nonnull String nameFormat, @Nonnull String friendlyName)
attribute - the attributename - the attribute namenameFormat - the attribute name formatfriendlyName - the attribute friendly nameCopyright © 1999–2015. All rights reserved.