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

Scott Cantor cantor.2 at osu.edu
Thu Mar 7 13:44:47 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=62fad8382d8d7fdb16a80a613b7823eff95b21d9

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

commit 62fad8382d8d7fdb16a80a613b7823eff95b21d9
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Mar 7 13:32:08 2019 -0500

    SSPCPP-848 - Can't change from default binding template
    
    https://issues.shibboleth.net/jira/browse/SSPCPP-848
---
 shibsp/impl/XMLApplication.cpp | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/shibsp/impl/XMLApplication.cpp b/shibsp/impl/XMLApplication.cpp
index 06f342a..21a9c31 100644
--- a/shibsp/impl/XMLApplication.cpp
+++ b/shibsp/impl/XMLApplication.cpp
@@ -716,6 +716,21 @@ void XMLApplication::doSSO(const ProtocolProvider& pp, set<string>& protocols, D
                 if (!hasChildElements) {
                     // 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, inittype.second);
                     e->appendChild(sidom);
                     log.info("adding SessionInitiator of type (%s) to chain (/Login)", initiator->getString("id").second);
@@ -740,7 +755,8 @@ void XMLApplication::doSSO(const ProtocolProvider& pp, set<string>& protocols, D
                 if (idprop.first && pathprop.first) {
                     DOMElement* acsdom = e->getOwnerDocument()->createElementNS(samlconstants::SAML20MD_NS, _AssertionConsumerService);
 
-                    // Copy in any attributes from the <SSO> element so they can be accessed as properties in the ACS handler.
+                    // Copy in any attributes from the <SSO> element so they can be accessed as properties in the ACS handler,
+                    // since the handlers aren't attached to the SSO element.
                     for (XMLSize_t p = 0; p < ssopropslen; ++p) {
                         DOMNode* ssoprop = ssoprops->item(p);
                         if (ssoprop->getNodeType() == DOMNode::ATTRIBUTE_NODE) {

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


More information about the commits mailing list