SAML1ArtifactDecoder::SAML1ArtifactDecoder(const DOMElement* e) {}
-SAML1ArtifactDecoder::~SAML1ArtifactDecoder() {}
-
-Response* SAML1ArtifactDecoder::decode(
+XMLObject* SAML1ArtifactDecoder::decode(
string& relayState,
const GenericRequest& genericRequest,
SecurityPolicy& policy
auto_ptr_char issuer(provider->getEntityID());
log.debug("lookup succeeded, artifact issued by (%s)", issuer.get());
}
+
+ // Mock up an Issuer object for the policy.
+ auto_ptr<saml2::Issuer> issuer(saml2::IssuerBuilder::buildIssuer());
+ issuer->setName(provider->getEntityID());
+ policy.setIssuer(issuer.get());
+ issuer.release(); // owned by policy now
log.debug("attempting to find artifact issuing role...");
const RoleDescriptor* roledesc=provider->getRoleDescriptor(*(policy.getRole()), samlconstants::SAML11_PROTOCOL_ENUM);
if (!roledesc || !dynamic_cast<const IDPSSODescriptor*>(roledesc)) {
log.error("unable to find compatible SAML role (%s) in metadata", policy.getRole()->toString().c_str());
for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup<SAMLArtifact>());
- BindingException ex("Unable to find compatible metadata role for artifact issuer.");
- annotateException(&ex,provider); // throws it
+ throw BindingException("Unable to find compatible metadata role for artifact issuer.");
}
+ policy.setIssuerMetadata(roledesc);
try {
auto_ptr<Response> response(
m_artifactResolver->resolve(artifacts, dynamic_cast<const IDPSSODescriptor&>(*roledesc), policy)
);
- policy.evaluate(genericRequest, *(response.get()));
+ policy.evaluate(*(response.get()), &genericRequest);
for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup<SAMLArtifact>());
return response.release();
}
- catch (XMLToolingException& ex) {
+ catch (XMLToolingException&) {
for_each(artifacts.begin(), artifacts.end(), xmltooling::cleanup<SAMLArtifact>());
- annotateException(&ex,roledesc,false);
throw;
}
}