|| (!xrd.getQuery().equals(sSubsegment))) {
return false;
}
// Must contain a SAML assertion
Assertion oAssertion = xrd.getSAMLAssertion();
if (oAssertion == null) {
return false;
}
// Assertion must also be valid
if (!oAssertion.isValid()) {
return false;
}
// Subject must have correct info
Subject oSubject = oAssertion.getSubject();
if (oSubject == null) {
return false;
}
NameID oNameID = oSubject.getNameID();
if (oNameID == null) {
return false;
}
if (!sSubsegment.equals(oNameID.getValue())) {
return false;
}
if (!sAuthorityID.equals(oNameID.getNameQualifier())) {
return false;
}
// must contain a SAML Attribute statement
AttributeStatement oAttrStmt = oAssertion.getAttributeStatement();
if (oAttrStmt == null) {
return false;
}
// Attribute must describe the XML ID reference