- 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
-
- // Check for an Issuer.
- const EntityDescriptor* provider=NULL;
- const vector<Assertion*>& assertions=const_cast<const Response*>(response)->getAssertions();
- if (!assertions.empty() || !policy.getMetadataProvider() ||
- !(provider=policy.getMetadataProvider()->getEntityDescriptor(assertions.front()->getIssuer(), false))) {
- // Just record it.
- auto_ptr_char iname(assertions.front()->getIssuer());
- if (iname.get())
- ex.addProperty("entityID", iname.get());
- throw;
- }
- if (policy.getRole()) {
- pair<bool,int> minor = response->getMinorVersion();
- const RoleDescriptor* roledesc=provider->getRoleDescriptor(
- *(policy.getRole()),
- (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM
- );
- if (roledesc) annotateException(&ex,roledesc); // throws it
- }
- annotateException(&ex,provider); // throws it
+ else if ((delim && strncmp(recipient.get(), recipient2, delim - recipient2)) || (!delim && strcmp(recipient.get(),recipient2))) {
+ log.error("POST targeted at (%s), but delivered to (%s)", recipient.get(), recipient2);
+ throw BindingException("SAML message delivered with POST to incorrect server URL.");