[cpp-sp] branch master updated: SSPCPP-848 - Can't change from default binding template

Scott Cantor cantor.2 at osu.edu
Thu Mar 7 15:03:08 EST 2019


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository cpp-sp.

View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=8d88c9d92b7f9cf515c281903f772877ef151c5d

The following commit(s) were added to refs/heads/master by this push:
       new  8d88c9d   SSPCPP-848 - Can't change from default binding template
8d88c9d is described below

commit 8d88c9d92b7f9cf515c281903f772877ef151c5d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Mar 7 15:02:39 2019 -0500

    SSPCPP-848 - Can't change from default binding template
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-848
    
    Extend to discovery and logout handlers.
---
 shibsp/impl/XMLApplication.cpp | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/shibsp/impl/XMLApplication.cpp b/shibsp/impl/XMLApplication.cpp
index 21a9c31..97abe20 100644
--- a/shibsp/impl/XMLApplication.cpp
+++ b/shibsp/impl/XMLApplication.cpp
@@ -822,6 +822,21 @@ void XMLApplication::doSSO(const ProtocolProvider& pp, set<string>& protocols, D
             if (discou && *discou) {
                 // Append a session initiator element of the designated type to the root element.
                 DOMElement* sidom = e->getOwnerDocument()->createElementNS(e->getNamespaceURI(), _SessionInitiator);
+
+                // Copy in any attributes from the <SSO> element so they can be accessed as properties in the SI handler
+                // but more importantly the MessageEncoders, which are DOM-aware only, not SP property-aware.
+                // The property-based lookups will walk up the DOM tree but the DOM-only code won't.
+                for (XMLSize_t p = 0; p < ssopropslen; ++p) {
+                    DOMNode* ssoprop = ssoprops->item(p);
+                    if (ssoprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
+                        sidom->setAttributeNS(
+                            ((DOMAttr*)ssoprop)->getNamespaceURI(),
+                            ((DOMAttr*)ssoprop)->getLocalName(),
+                            ((DOMAttr*)ssoprop)->getValue()
+                        );
+                    }
+                }
+
                 sidom->setAttributeNS(nullptr, _type, discop);
                 sidom->setAttributeNS(nullptr, _URL, discou);
                 e->appendChild(sidom);
@@ -878,6 +893,21 @@ void XMLApplication::doLogout(const ProtocolProvider& pp, set<string>& protocols
                 if (!hasChildElements) {
                     // Append a logout initiator element of the designated type to the root element.
                     DOMElement* lidom = e->getOwnerDocument()->createElementNS(e->getNamespaceURI(), _LogoutInitiator);
+
+                    // Copy in any attributes from the <Logout> element so they can be accessed as properties in the LI handler
+                    // but more importantly the MessageEncoders, which are DOM-aware only, not SP property-aware.
+                    // The property-based lookups will walk up the DOM tree but the DOM-only code won't.
+                    for (XMLSize_t p = 0; p < slopropslen; ++p) {
+                        DOMNode* sloprop = sloprops->item(p);
+                        if (sloprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {
+                            lidom->setAttributeNS(
+                                ((DOMAttr*)sloprop)->getNamespaceURI(),
+                                ((DOMAttr*)sloprop)->getLocalName(),
+                                ((DOMAttr*)sloprop)->getValue()
+                            );
+                        }
+                    }
+
                     lidom->setAttributeNS(nullptr, _type, inittype.second);
                     e->appendChild(lidom);
                     log.info("adding LogoutInitiator of type (%s) to chain (/Logout)", initiator->getString("id").second);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list