Propagate SAML 2 errors from artifact resolver.
DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
#ifdef SHIBSP_LITE
-DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
DECL_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
DECL_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
DECL_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
DECL_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
#endif
namespace shibsp {
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
#ifdef SHIBSP_LITE
+ REGISTER_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
REGISTER_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
throw BindingException("Unable to resolve artifact(s) into a SAML response.");
else 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.");
+ auto_ptr<ArtifactResponse> wrapper(response);
+ BindingException ex("Identity provider returned a SAML error in response to artifact.");
+ annotateException(&ex, &ssoDescriptor, response->getStatus()); // rethrow
}
return response;
}
#ifdef SHIBSP_LITE
namespace opensaml {
+ DECL_XMLTOOLING_EXCEPTION(BindingException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::XMLToolingException,Exceptions in SAML binding processing);
DECL_XMLTOOLING_EXCEPTION(SecurityPolicyException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::XMLToolingException,Exceptions in security policy processing);
DECL_XMLTOOLING_EXCEPTION(ProfileException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,xmltooling::ValidationException,Exceptions in SAML profile processing);
DECL_XMLTOOLING_EXCEPTION(FatalProfileException,SHIBSP_EXCEPTIONAPI(SHIBSP_API),opensaml,ProfileException,Fatal exceptions in SAML profile processing);