<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi All, <div class=""><br class=""></div><div class="">Again me, sorry, but the migration to OpenSAMLV3.3.0 is creating some troubles, </div><div class="">and probably I’m doing some very bad things. </div><div class=""><br class=""></div><div class="">The SAMLSignatureProfileValidator fails because the ID is not registered. </div><div class=""><br class=""></div><div class="">Line 156 uses the deprecated getElementByID from IdResolver that, in xmlsec version 2.0.5 (used by shibboleth) and 2.0.8 is of course calling org.w3.dom.DeferredDocumentImpl.getElementById. which returns null, obtaining</div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">11:08:30.910 [main] ERROR o.o.s.s.i.SAMLSignatureProfileValidator - Apache xmlsec IdResolver could not resolve the Element for id reference: _f851e9ff-aa45-4a60-9719-55730344c52e</div></div><div class=""><br class=""></div><div class="">(note that the element is there as you can see from the attached SOAP). Using this code, the id is resolved: </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> Assertion <span style="color: #7e504f" class="">assertion</span> = SoapUtils.createSaml(<span style="color: #0326cc" class="">localcert</span>, <span style="color: #0326cc" class="">localkey</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> String <span style="color: #7e504f" class="">id</span> = <span style="color: #7e504f" class="">assertion</span>.getID();</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> Element <span style="color: #7e504f" class="">assertionElement</span> = SAML2Utilities.toElement(<span style="color: #7e504f" class="">assertion</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; color: rgb(78, 144, 114);" class=""> Element <span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">idEleme</span> = <span style="text-decoration: underline line-through;" class="">IdResolver</span>.<span style="text-decoration: underline line-through;" class="">getElementById</span><span style="text-decoration: underline;" class="">(</span><span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">assertionElement</span><span style="text-decoration: underline;" class="">.getOwnerDocument(), </span><span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">id</span><span style="text-decoration: underline;" class="">)</span>;</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">assertionElement</span>.setIdAttribute(<span style="color: #3933ff" class="">"ID"</span>, <span style="color: #931a68" class="">true</span>);</div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; color: rgb(78, 144, 114);" class=""> Element <span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">idEleme2</span> = <span style="text-decoration: underline line-through;" class="">IdResolver</span>.<span style="text-decoration: underline line-through;" class="">getElementById</span><span style="text-decoration: underline;" class="">(</span><span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">assertionElement</span><span style="text-decoration: underline;" class="">.getOwnerDocument(), </span><span style="text-decoration: underline; color: rgb(126, 80, 79);" class="">id</span><span style="text-decoration: underline;" class="">)</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""> <br class="webkit-block-placeholder"></p></div><div class="">The first idEleme is null, the second is not null. In order to make it working, I’ve to manually register the ID element in the toElement method (which is easy as it can be, see inline). </div><div class=""><br class=""></div><div class="">Worthless to say that this code was working perfectly in OpenSAML 2.6.1. Any ideas?</div><div class="">Did I do some obvious mistakes?</div><div class=""><br class=""></div><div class="">Thanks a LOT!</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> Marshaller <span style="color: #7e504f" class="">marshaller</span> = <span style="color: #7e504f" class="">marshallerFactory</span>.getMarshaller(<span style="color: #7e504f" class="">a</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; min-height: 15px;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> Element <span style="color: #7e504f" class="">assertionElement</span> = <span style="color: #931a68" class="">null</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #931a68" class="">try</span> {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">assertionElement</span> = <span style="color: #7e504f" class="">marshaller</span>.marshall(<span style="color: #7e504f" class="">a</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">assertionElement</span>.setIdAttribute(<span style="color: #3933ff" class="">"ID"</span>, <span style="color: #931a68" class="">true</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco; color: rgb(126, 80, 79);" class=""><span style="color: #000000" class=""> </span><span style="color: #931a68" class="">return</span><span style="color: #000000" class=""> </span>assertionElement<span style="color: #000000" class="">;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> } <span style="color: #931a68" class="">catch</span> (Throwable <span style="color: #7e504f" class="">e1</span>) {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #7e504f" class="">e1</span>.printStackTrace();</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <span style="color: #931a68" class="">throw</span> <span style="color: #931a68" class="">new</span> GeneralSAMLException(<span style="color: #3933ff" class="">"Unable to marshall the assertion: "</span> + <span style="color: #7e504f" class="">e1</span>.getMessage(), <span style="color: #7e504f" class="">e1</span>);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> }</div></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><span style="font-family: Arial; font-size: 14px;" class="">The attached SOAP.</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><span style="font-family: Arial; font-size: 14px;" class=""><br class=""></span></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><?xml version="1.0" encoding="UTF-8" standalone="yes"?></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><s:Envelope xmlns:s="<a href="http://www.w3.org/2003/05/soap-envelope" class="">http://www.w3.org/2003/05/soap-envelope</a>"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <s:Header></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <wsse:Security s:mustUnderstand="true" xmlns:wsse="<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" class="">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</a>" xmlns:wsu="<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" class="">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd</a>"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:Assertion ID="_f851e9ff-aa45-4a60-9719-55730344c52e" IssueInstant="2017-05-09T09:07:27.513Z" Version="2.0" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:Issuer Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">Issuer</saml2:Issuer></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:Signature xmlns:ds="<a href="http://www.w3.org/2000/09/xmldsig" class="">http://www.w3.org/2000/09/xmldsig</a>#"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:SignedInfo></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:CanonicalizationMethod Algorithm="<a href="http://www.w3.org/2001/10/xml-exc-c14n" class="">http://www.w3.org/2001/10/xml-exc-c14n</a>#"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:SignatureMethod Algorithm="<a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1" class="">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a>"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:Reference URI="#_f851e9ff-aa45-4a60-9719-55730344c52e"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:Transforms></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:Transform Algorithm="<a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature" class="">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a>"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:Transform Algorithm="<a href="http://www.w3.org/2001/10/xml-exc-c14n" class="">http://www.w3.org/2001/10/xml-exc-c14n</a>#"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:Transforms></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:DigestMethod Algorithm="<a href="http://www.w3.org/2001/04/xmlenc#sha256" class="">http://www.w3.org/2001/04/xmlenc#sha256</a>"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:DigestValue>wrkpFgSlV78Jy2tnnt/6SHhIyrRSKyl9RF5I0351RXE=</ds:DigestValue></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:Reference></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:SignedInfo></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:SignatureValue></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">sDrB94mJj5nBvLXs+++6yoj5GMNXHEGYUCV073tht4/XMUinA7FZqj15zXvVlFpHx+COB+C2IRO8</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">b7BOanxZiQpYoKWwQM8QEeCIHls63wQ+tLr9v/GSH0iHjIR681R6cWAY1HsowcKiuvwQ1sVq4tAE</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class="">eL3yMR9JTqxZcG5nr7k=</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""></ds:SignatureValue></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:KeyInfo></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509Data></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509Certificate>MIICTzCCAbigAwIBAgICARswDQYJKoZIhvcNAQENBQAwOjELMAkGA1UEBhMCRlIxEzARBgNVBAoMCklIRSBFdXJvcGUxFjAUBgNVBAMMDUlIRSBFdXJvcGUgQ0EwHhcNMTQwMzA2MTQzNDA5WhcNMjQwMzA2MTQzNDA5WjCBnzELMAkGA1UEBhMCQVQxFTATBgNVBAoMDFRpYW5pIFNwaXJpdDESMBAGA1UEAwwJVGlhbmkgRUhSMRUwEwYDVQQqDAxNYXNzaW1pbGlhbm8xDTALBgNVBAUTBE1hc2kxGDAWBgNVBAsMD0NBVCBWaWVubmEgMjAxNDElMCMGCSqGSIb3DQEJARYWbWFzc2lAdGlhbmktc3Bpcml0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzc8nsEePV9CwT25cR99EM/EDh7w/0KgG/InSWFNIIIUMw/dx6pDVZhPw8w3G4GfllT5w1dw//plkI1HWPlrsxcoHpAxor0AUMxpW4TZFht5q8dSZkNjJTJOwZd7SEx71brO0wQ5+uNsfjBuSIyecpH+DfPqpi9Hw6a9l6qMOiL0CAwEAATANBgkqhkiG9w0BAQ0FAAOBgQAYRZgUu1QADeLr2E0DFvwv2zQ1Erv2f9uUzeyvKXjuvrU17XgNu8YJxWquuffchhR6DYKIoIKpo/Dbc296AlYOEvLqhHmkjt9t2v+Mx51HYgUF1kI0M7lbDKEeW7Rdm5jenFVm4eYCQCj3Mcwy4RNMnAMXu+Kr4YGW0n1EcgffSQ==</ds:X509Certificate></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509SubjectName>EMAILADDRESS=massi</ds:X509SubjectName></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509IssuerSerial></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509IssuerName>CN=CA</ds:X509IssuerName></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509SerialNumber>283</ds:X509SerialNumber></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:X509IssuerSerial></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:X509Data></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:KeyInfo></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:Signature></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:Subject></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">Username</saml2:NameID></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:holder-of-key"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:SubjectConfirmationData></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:KeyInfo xmlns:ds="<a href="http://www.w3.org/2000/09/xmldsig" class="">http://www.w3.org/2000/09/xmldsig</a>#"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509Data></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509Certificate>MIICTzCCAbigAwIBAgICARswDQYJKoZIhvcNAQENBQAwOjELMAkGA1UEBhMCRlIxEzARBgNVBAoMCklIRSBFdXJvcGUxFjAUBgNVBAMMDUlIRSBFdXJvcGUgQ0EwHhcNMTQwMzA2MTQzNDA5WhcNMjQwMzA2MTQzNDA5WjCBnzELMAkGA1UEBhMCQVQxFTATBgNVBAoMDFRpYW5pIFNwaXJpdDESMBAGA1UEAwwJVGlhbmkgRUhSMRUwEwYDVQQqDAxNYXNzaW1pbGlhbm8xDTALBgNVBAUTBE1hc2kxGDAWBgNVBAsMD0NBVCBWaWVubmEgMjAxNDElMCMGCSqGSIb3DQEJARYWbWFzc2lAdGlhbmktc3Bpcml0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzc8nsEePV9CwT25cR99EM/EDh7w/0KgG/InSWFNIIIUMw/dx6pDVZhPw8w3G4GfllT5w1dw//plkI1HWPlrsxcoHpAxor0AUMxpW4TZFht5q8dSZkNjJTJOwZd7SEx71brO0wQ5+uNsfjBuSIyecpH+DfPqpi9Hw6a9l6qMOiL0CAwEAATANBgkqhkiG9w0BAQ0FAAOBgQAYRZgUu1QADeLr2E0DFvwv2zQ1Erv2f9uUzeyvKXjuvrU17XgNu8YJxWquuffchhR6DYKIoIKpo/Dbc296AlYOEvLqhHmkjt9t2v+Mx51HYgUF1kI0M7lbDKEeW7Rdm5jenFVm4eYCQCj3Mcwy4RNMnAMXu+Kr4YGW0n1EcgffSQ==</ds:X509Certificate></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509SubjectName>EMAILADDRESS=massi</ds:X509SubjectName></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509IssuerSerial></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509IssuerName>CN=CA</ds:X509IssuerName></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ds:X509SerialNumber>283</ds:X509SerialNumber></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:X509IssuerSerial></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:X509Data></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </ds:KeyInfo></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:SubjectConfirmationData></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:SubjectConfirmation></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:Subject></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:Conditions NotBefore="2017-05-09T09:07:27.513Z" NotOnOrAfter="2017-05-09T14:07:27.513Z"/></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:AuthnStatement AuthnInstant="2017-05-09T09:07:27.513Z" SessionIndex="123456" SessionNotOnOrAfter="2017-05-09T14:07:27.513Z"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:AuthnContext></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <saml2:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:Password</saml2:AuthnContextClassRef></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:AuthnContext></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:AuthnStatement></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </saml2:Assertion></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </wsse:Security></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </s:Header></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <s:Body></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> <ns1:sampleValue xmlns:ns1="urn:tiani-spirit:test"></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span>this is a value</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""><span class="Apple-tab-span" style="white-space:pre"> </span></ns1:sampleValue></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""> </s:Body></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Monaco;" class=""></s:Envelope></div><br class=""><div class="">
--<br class="">Anger is a gift, <a href="http://www.mascanc.net/" class="">http://www.mascanc.net/</a>
</div>
<br class=""></div></body></html>