#include "internal.h"
#include "exceptions.h"
-#include "binding/MessageDecoder.h"
+#include "saml1/binding/SAML1MessageDecoder.h"
#include "saml1/core/Assertions.h"
#include "saml1/core/Protocols.h"
#include "saml2/metadata/Metadata.h"
namespace opensaml {
namespace saml1p {
- class SAML_DLLLOCAL SAML1POSTDecoder : public MessageDecoder
+ class SAML_DLLLOCAL SAML1POSTDecoder : public SAML1MessageDecoder
{
public:
SAML1POSTDecoder() {}
const char* samlResponse = httpRequest->getParameter("SAMLResponse");
const char* TARGET = httpRequest->getParameter("TARGET");
if (!samlResponse || !TARGET)
- throw BindingException("Request missing SAMLResponse or TARGET parameters.");
+ throw BindingException("Request missing SAMLResponse or TARGET form parameters.");
relayState = TARGET;
// Decode the base64 into SAML.
throw BindingException("Decoded message was not a SAML 1.x Response.");
if (!policy.getValidating())
- SchemaValidators.validate(xmlObject.get());
+ SchemaValidators.validate(response);
+
+ pair<bool,int> minor = response->getMinorVersion();
+ extractMessageDetails(
+ *response,
+ genericRequest,
+ (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM,
+ policy
+ );
// Run through the policy.
- policy.evaluate(*response, &genericRequest);
+ policy.evaluate(*response,&genericRequest);
// Check recipient URL.
auto_ptr_char recipient(response->getRecipient());