From: Scott Cantor Date: Wed, 12 Aug 2009 14:53:12 +0000 (+0000) Subject: https://issues.shibboleth.net/jira/browse/SSPCPP-230 X-Git-Tag: 2.2.1~5 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-sp.git;a=commitdiff_plain;h=b1064255969a89ffc62a65d1c48602a093af6558 https://issues.shibboleth.net/jira/browse/SSPCPP-230 --- diff --git a/shibsp/handler/impl/SAML2Logout.cpp b/shibsp/handler/impl/SAML2Logout.cpp index 4b5da95..9a2e71a 100644 --- a/shibsp/handler/impl/SAML2Logout.cpp +++ b/shibsp/handler/impl/SAML2Logout.cpp @@ -174,8 +174,14 @@ SAML2Logout::SAML2Logout(const DOMElement* e, const char* appId) MessageEncoder * encoder = conf.MessageEncoderManager.newPlugin( b.get(), pair(e,shibspconstants::SHIB2SPCONFIG_NS) ); - m_encoders[start] = encoder; - m_log.debug("supporting outgoing front-channel binding (%s)", b.get()); + if (encoder->isUserAgentPresent()) { + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + else { + delete encoder; + m_log.warn("skipping outgoing binding (%s), not a front-channel mechanism", b.get()); + } } catch (exception& ex) { m_log.error("error building MessageEncoder: %s", ex.what()); diff --git a/shibsp/handler/impl/SAML2LogoutInitiator.cpp b/shibsp/handler/impl/SAML2LogoutInitiator.cpp index e5a6bbb..249eb8f 100644 --- a/shibsp/handler/impl/SAML2LogoutInitiator.cpp +++ b/shibsp/handler/impl/SAML2LogoutInitiator.cpp @@ -139,8 +139,14 @@ SAML2LogoutInitiator::SAML2LogoutInitiator(const DOMElement* e, const char* appI auto_ptr_char b(start); MessageEncoder * encoder = SAMLConfig::getConfig().MessageEncoderManager.newPlugin(b.get(),pair(e,NULL)); - m_encoders[start] = encoder; - m_log.debug("supporting outgoing binding (%s)", b.get()); + if (encoder->isUserAgentPresent()) { + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + else { + delete encoder; + m_log.warn("skipping outgoing binding (%s), not a front-channel mechanism", b.get()); + } } catch (exception& ex) { m_log.error("error building MessageEncoder: %s", ex.what()); diff --git a/shibsp/handler/impl/SAML2NameIDMgmt.cpp b/shibsp/handler/impl/SAML2NameIDMgmt.cpp index 56b38eb..3af13a5 100644 --- a/shibsp/handler/impl/SAML2NameIDMgmt.cpp +++ b/shibsp/handler/impl/SAML2NameIDMgmt.cpp @@ -170,8 +170,14 @@ SAML2NameIDMgmt::SAML2NameIDMgmt(const DOMElement* e, const char* appId) MessageEncoder * encoder = conf.MessageEncoderManager.newPlugin( b.get(), pair(e,shibspconstants::SHIB2SPCONFIG_NS) ); - m_encoders[start] = encoder; - m_log.debug("supporting outgoing front-channel binding (%s)", b.get()); + if (encoder->isUserAgentPresent()) { + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + else { + delete encoder; + m_log.warn("skipping outgoing binding (%s), not a front-channel mechanism", b.get()); + } } catch (exception& ex) { m_log.error("error building MessageEncoder: %s", ex.what()); diff --git a/shibsp/handler/impl/SAML2SessionInitiator.cpp b/shibsp/handler/impl/SAML2SessionInitiator.cpp index c6a8d5f..ae14e44 100644 --- a/shibsp/handler/impl/SAML2SessionInitiator.cpp +++ b/shibsp/handler/impl/SAML2SessionInitiator.cpp @@ -174,8 +174,14 @@ SAML2SessionInitiator::SAML2SessionInitiator(const DOMElement* e, const char* ap MessageEncoder * encoder = SAMLConfig::getConfig().MessageEncoderManager.newPlugin( b.get(),pair(e,NULL) ); - m_encoders[start] = encoder; - m_log.debug("supporting outgoing binding (%s)", b.get()); + if (encoder->isUserAgentPresent()) { + m_encoders[start] = encoder; + m_log.debug("supporting outgoing binding (%s)", b.get()); + } + else { + delete encoder; + m_log.warn("skipping outgoing binding (%s), not a front-channel mechanism", b.get()); + } } catch (exception& ex) { m_log.error("error building MessageEncoder: %s", ex.what());