- try {
- if (!m_validate)
- SchemaValidators.validate(xmlObject.get());
-
- // Check destination URL.
- auto_ptr_char dest(request ? request->getDestination() : response->getDestination());
- const char* dest2 = httpRequest->getRequestURL();
- if (root->getSignature() && !dest.get() || !*(dest.get())) {
- log.error("signed SAML message missing Destination attribute");
- throw BindingException("Signed SAML message missing Destination attribute identifying intended destination.");
- }
- else if (dest.get() && (!dest2 || !*dest2 || strcmp(dest.get(),dest2))) {
- log.error("POST targeted at (%s), but delivered to (%s)", dest.get(), dest2 ? dest2 : "none");
- throw BindingException("SAML message delivered with POST to incorrect server URL.");
- }
-
- // Run through the policy.
- policy.evaluate(genericRequest, *response);
- }
- catch (XMLToolingException& ex) {
- // This is just to maximize the likelihood of attaching a source to the message for support purposes.
- if (policy.getIssuerMetadata())
- annotateException(&ex,policy.getIssuerMetadata()); // throws it