request->getAssertionArtifacts().push_back(aa);
}
- SAML1SOAPClient client(soaper);
+ SAML1SOAPClient client(soaper, false);
client.sendSAML(request, mcc, loc.get());
response = client.receiveSAML();
}
}
if (!response)
- throw BindingException("Unable to successfully resolve artifact(s).");
+ throw BindingException("Unable to resolve artifact(s) into a SAML response.");
+ const QName* code = (response->getStatus() && response->getStatus()->getStatusCode()) ? response->getStatus()->getStatusCode()->getValue() : NULL;
+ if (!code || *code != saml1p::StatusCode::SUCCESS) {
+ delete response;
+ throw BindingException("Identity provider returned a SAML error in response to artifact(s).");
+ }
+
return response;
}
a->setArtifact(artbuf.get());
request->setArtifact(a);
- SAML2SOAPClient client(soaper);
+ SAML2SOAPClient client(soaper, false);
client.sendSAML(request, mcc, loc.get());
StatusResponseType* srt = client.receiveSAML();
if (!(response = dynamic_cast<ArtifactResponse*>(srt))) {
}
if (!response)
- throw BindingException("Unable to successfully resolve artifact.");
+ throw BindingException("Unable to resolve artifact(s) into a SAML response.");
+ if (!response->getStatus() || !response->getStatus()->getStatusCode() ||
+ !XMLString::equals(response->getStatus()->getStatusCode()->getValue(), saml2p::StatusCode::SUCCESS)) {
+ delete response;
+ throw BindingException("Identity provider returned a SAML error in response to artifact.");
+ }
return response;
}