/*
- * Copyright 2001-2007 Internet2
- *
+ * Copyright 2001-2009 Internet2
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/**
* SAML2MessageDecoder.cpp
- *
+ *
* Base class for SAML 2.0 MessageDecoders.
*/
#include "internal.h"
-#include "exceptions.h"
+#include "binding/SecurityPolicy.h"
#include "saml2/binding/SAML2MessageDecoder.h"
#include "saml2/core/Protocols.h"
#include "saml2/metadata/Metadata.h"
using namespace xmltooling;
using namespace std;
+SAML2MessageDecoder::SAML2MessageDecoder()
+{
+}
+
+SAML2MessageDecoder::~SAML2MessageDecoder()
+{
+}
+
void SAML2MessageDecoder::extractMessageDetails(
const XMLObject& message, const GenericRequest& request, const XMLCh* protocol, SecurityPolicy& policy
) const
{
// Only handle SAML 2.0 messages.
- const QName& q = message.getElementQName();
+ const xmltooling::QName& q = message.getElementQName();
if (!XMLString::equals(q.getNamespaceURI(), samlconstants::SAML20P_NS))
return;
policy.setIssuer(issuer);
}
else if (XMLString::equals(q.getLocalPart(), Response::LOCAL_NAME)) {
- // No issuer in the message, so we have to try the Response approach.
+ // No issuer in the message, so we have to try the Response approach.
const vector<saml2::Assertion*>& assertions = dynamic_cast<const Response&>(samlRoot).getAssertions();
if (!assertions.empty()) {
issuer = assertions.front()->getIssuer();
log.warn("non-system entity issuer, skipping metadata lookup");
return;
}
-
- log.debug("searching metadata for message issuer...");
- MetadataProvider::Criteria mc(issuer->getName(), policy.getRole(), protocol);
+ log.debug("searching metadata for message issuer...");
+ MetadataProvider::Criteria& mc = policy.getMetadataProviderCriteria();
+ mc.entityID_unicode = issuer->getName();
+ mc.role = policy.getRole();
+ mc.protocol = protocol;
pair<const EntityDescriptor*,const RoleDescriptor*> entity = policy.getMetadataProvider()->getEntityDescriptor(mc);
if (!entity.first) {
auto_ptr_char temp(issuer->getName());