public class SAML2TestResponseValidator extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
idpEntityID
Expected IdP entity ID.
|
org.opensaml.saml.saml2.core.NameID |
nameID
Expected name identifier.
|
org.opensaml.security.credential.Credential |
spCredential
SP credential.
|
String |
spEntityID
Expected SP entity ID.
|
protected String |
statusCode
Expected status code.
|
protected String |
statusCodeNested
Expected nested status code when an error occurs.
|
protected String |
statusMessage
Expected status message when an error occurs.
|
String |
subjectConfirmationMethod
Expected subject confirmation method.
|
boolean |
validateAuthnStatements
Whether authn statements should be validated.
|
boolean |
validateSubjectConfirmationData
Whether subject confirmation data should be validated.
|
| 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 two attributes are present.
|
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 authnContextClassRef)
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 |
assertResponse(org.opensaml.saml.saml2.core.Response response)
Assert that :
the response ID is not null nor empty
the response issue instant is not null
the response version is
SAMLVersion.VERSION_20
the response issuer is the expected IdP entity ID
|
void |
assertStatus(org.opensaml.saml.saml2.core.Status status)
Assert that :
the status is not null
the status code is not null
the status code is the expected status code
the status message is the expected status message if the status code is not success
the nested status message is the expected nested status message if the status is not success
|
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.
|
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.
|
@Nullable public org.opensaml.security.credential.Credential spCredential
@Nonnull public org.opensaml.saml.saml2.core.NameID nameID
@Nonnull protected String statusCodeNested
@Nonnull public String subjectConfirmationMethod
@Nonnull public boolean validateAuthnStatements
@Nonnull public boolean validateSubjectConfirmationData
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 :
Calls assert methods :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 assertResponse(@Nullable org.opensaml.saml.saml2.core.Response response)
SAMLVersion.VERSION_20response - the responsepublic void assertStatus(@Nullable org.opensaml.saml.saml2.core.Status status)
status - the statuspublic 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.subjectConfirmation - 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)
nameID - 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 authnContextClassRef)
AuthnContext.IP_AUTHN_CTX.authnContextClassRef - the authn context class refpublic 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)
The first attribute is
Attribute.URI_REFERENCEThe second attribute is
Attribute.URI_REFERENCEattributes - 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–2014. All rights reserved.