X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1ArtifactEncoder.cpp;h=8531df2f80a6839336e3b20081cb96416c33b11a;hb=197bcbae7339bc779bc5780882d11fdeb45f8223;hp=7252831ffa34946d41a27b9bde60571263b8a60a;hpb=1bc8e721db3a50294df852662e1eddcdbdae8f9f;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp index 7252831..8531df2 100644 --- a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Internet2 + * Copyright 2001-2007 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,13 +24,15 @@ #include "exceptions.h" #include "binding/ArtifactMap.h" #include "binding/HTTPResponse.h" +#include "binding/MessageEncoder.h" #include "binding/SAMLArtifact.h" -#include "binding/URLEncoder.h" -#include "saml1/binding/SAML1ArtifactEncoder.h" #include "saml1/core/Assertions.h" +#include "saml1/core/Protocols.h" #include +#include #include +#include using namespace opensaml::saml1; using namespace opensaml::saml1p; @@ -42,6 +44,23 @@ using namespace std; namespace opensaml { namespace saml1p { + class SAML_DLLLOCAL SAML1ArtifactEncoder : public MessageEncoder + { + public: + SAML1ArtifactEncoder(const DOMElement* e) {} + virtual ~SAML1ArtifactEncoder() {} + + long encode( + GenericResponse& genericResponse, + xmltooling::XMLObject* xmlObject, + const char* destination, + const char* recipientID=NULL, + const char* relayState=NULL, + const xmltooling::CredentialResolver* credResolver=NULL, + const XMLCh* sigAlgorithm=NULL + ) const; + }; + MessageEncoder* SAML_DLLLOCAL SAML1ArtifactEncoderFactory(const DOMElement* const & e) { return new SAML1ArtifactEncoder(e); @@ -49,10 +68,6 @@ namespace opensaml { }; }; -SAML1ArtifactEncoder::SAML1ArtifactEncoder(const DOMElement* e) {} - -SAML1ArtifactEncoder::~SAML1ArtifactEncoder() {} - long SAML1ArtifactEncoder::encode( GenericResponse& genericResponse, XMLObject* xmlObject, @@ -99,7 +114,7 @@ long SAML1ArtifactEncoder::encode( // Generate redirect. string loc = destination; loc += (strchr(destination,'?') ? '&' : '?'); - URLEncoder* escaper = SAMLConfig::getConfig().getURLEncoder(); + const URLEncoder* escaper = XMLToolingConfig::getConfig().getURLEncoder(); loc = loc + "SAMLart=" + escaper->encode(artifact->encode().c_str()) + "&TARGET=" + escaper->encode(relayState); log.debug("message encoded, sending redirect to client"); return httpResponse->sendRedirect(loc.c_str());