-
- // Pass back output fields.
- outputFields["SAMLResponse"] = xmlbuf;
- outputFields["TARGET"] = relayState;
+
+ // Fill in the rest of the data and send to the client.
+ log.debug("message encoded, sending HTML form template to client");
+ ifstream infile(m_template.c_str());
+ if (!infile)
+ throw BindingException("Failed to open HTML template for POST response ($1).", params(1,m_template.c_str()));
+ pmap.m_map["action"] = destination;
+ pmap.m_map["TARGET"] = relayState;
+ stringstream s;
+ engine->run(infile, s, pmap);
+ genericResponse.setContentType("text/html");
+ HTTPResponse* httpResponse = dynamic_cast<HTTPResponse*>(&genericResponse);
+ if (httpResponse) {
+ httpResponse->setResponseHeader("Expires", "01-Jan-1997 12:00:00 GMT");
+ httpResponse->setResponseHeader("Cache-Control", "no-cache, no-store, must-revalidate, private");
+ httpResponse->setResponseHeader("Pragma", "no-cache");
+ }
+ long ret = genericResponse.sendResponse(s);