#include "internal.h"
#include "Application.h"
#include "ServiceProvider.h"
+#include "SPRequest.h"
#include "attribute/AttributeDecoder.h"
#include "attribute/resolver/AttributeExtractor.h"
#include "util/SPConstants.h"
const Application& application, const char* assertingParty, const saml2::Attribute& attr, multimap<string,Attribute*>& attributes
) const;
+ void clearHeaders(SPRequest& request) const {
+ for (vector<string>::const_iterator i = m_attributeIds.begin(); i!=m_attributeIds.end(); ++i)
+ request.clearHeader(i->c_str());
+ }
+
private:
Category& m_log;
DOMDocument* m_document;
typedef map< pair<string,string>,pair<AttributeDecoder*,string> > attrmap_t;
#endif
attrmap_t m_attrMap;
+ vector<string> m_attributeIds;
};
class XMLExtractor : public AttributeExtractor, public ReloadableXMLFile
const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, multimap<string,Attribute*>& attributes
) const;
+ void clearHeaders(SPRequest& request) const {
+ if (m_impl)
+ m_impl->clearHeaders(request);
+ }
+
protected:
pair<bool,DOMElement*> load();
child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME);
continue;
}
+ else if (!strcmp(id.get(), "REMOTE_USER")) {
+ m_log.warn("skipping Attribute, id of REMOTE_USER is a reserved name");
+ child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME);
+ continue;
+ }
AttributeDecoder* decoder=NULL;
try {
decl.first = decoder;
decl.second = id.get();
+ m_attributeIds.push_back(id.get());
child = XMLHelper::getNextSiblingElement(child, shibspconstants::SHIB2ATTRIBUTEMAP_NS, saml1::Attribute::LOCAL_NAME);
}
const Application& application, const RoleDescriptor* issuer, const XMLObject& xmlObject, multimap<string,Attribute*>& attributes
) const
{
+ if (!m_impl)
+ return;
+
// Check for assertions.
if (XMLString::equals(xmlObject.getElementQName().getLocalPart(), saml1::Assertion::LOCAL_NAME)) {
const saml2::Assertion* token2 = dynamic_cast<const saml2::Assertion*>(&xmlObject);