https://issues.shibboleth.net/jira/browse/SSPCPP-469
authorscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 10 Jul 2012 18:40:42 +0000 (18:40 +0000)
committerscantor <scantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 10 Jul 2012 18:40:42 +0000 (18:40 +0000)
git-svn-id: https://svn.shibboleth.net/cpp-sp/branches/REL_2@3728 cb58f699-b61c-0410-a6fe-9272a202ed29

msi/WiX/MergeModules/OpenSAML-schemas.wxs
shibsp/handler/impl/SAML2LogoutInitiator.cpp

index db9d8ec..b97ae4f 100644 (file)
                 <Component Id='protocol_ext_thirdparty.xsd' Guid='{EEFDA0C0-F1F4-4C09-82CD-873F037A4296}'>\r
                   <File KeyPath='yes' Id='protocol_ext_thirdparty.xsd' Name='sstc-saml-protocol-ext-thirdparty.xsd' />\r
                 </Component>\r
+                <Component Id='async_slo_v1.0.xsd' Guid='{C3209C47-3F6D-4C20-B004-C85DDC4AD7E7}'>\r
+                  <File KeyPath='yes' Id='async_slo_v1.0.xsd' Name='saml-async-slo-v1.0.xsd' />\r
+                </Component>\r
               </Directory><!-- opensaml -->\r
               <Directory Id='xmltooling' Name='xmltooling' FileSource='$(var.SPBuildDirectory)\cpp-xmltooling\schemas\' >\r
                 <Component Id='xenc_schema.xsd' Guid='{2197D645-3AA3-46F1-B250-0F964B901A94}'>\r
index 7ae8f39..a97e1e8 100644 (file)
@@ -101,6 +101,7 @@ namespace shibsp {
             return e;
         }
 
+        bool m_async;
         vector<string> m_bindings;
         map< string,boost::shared_ptr<MessageEncoder> > m_encoders;
 #endif
@@ -119,6 +120,9 @@ namespace shibsp {
 
 SAML2LogoutInitiator::SAML2LogoutInitiator(const DOMElement* e, const char* appId)
     : AbstractHandler(e, Category::getInstance(SHIBSP_LOGCAT".LogoutInitiator.SAML2")), m_appId(appId), m_protocol(samlconstants::SAML20P_NS)
+#ifndef SHIBSP_LITE
+        ,m_async(true)
+#endif
 {
     // If Location isn't set, defer initialization until the setParent call.
     pair<bool,const char*> loc = getString("Location");
@@ -146,6 +150,9 @@ void SAML2LogoutInitiator::init(const char* location)
 
 #ifndef SHIBSP_LITE
     if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
+        pair<bool,bool> async = getBool("asynchronous");
+        m_async = !async.first || async.second;
+
         string dupBindings;
         pair<bool,const char*> outgoing = getString("outgoingBindings");
         if (outgoing.first) {
@@ -523,6 +530,11 @@ auto_ptr<LogoutRequest> SAML2LogoutInitiator::buildRequest(
     msg->setID(SAMLConfig::getConfig().generateIdentifier());
     msg->setIssueInstant(time(nullptr));
 
+    if (m_async) {
+        msg->setExtensions(saml2p::ExtensionsBuilder::buildExtensions());
+        msg->getExtensions()->getUnknownXMLObjects().push_back(AsynchronousBuilder::buildAsynchronous());
+    }
+
     return msg;
 }