OpenSAML2 Problem with Signing an Assertion (does not verify)
Brent Putman
putmanb at georgetown.edu
Wed Feb 15 08:38:08 GMT 2012
On 2/15/12 3:11 AM, Johannes Frey wrote:
>
>
> public String toString() {
> Element saml;
> String samlDocument = null;
> setRightAssertion();
> try {
> saml = marshallResponse();
> samlDocument = XMLHelper.prettyPrintXML(saml);
>
The error is here. Serializing the DOM element with the pretty print
method introduces additional whitespace, which corrupts your document
and means that the signature is no longer valid. It's only for use in
printing out nice human-readable indented XML. For the actual
operational message, serialize instead with the
XMLHelper.nodeToString(Node node) method, which doesn't modify the
source DOM.
More information about the dev
mailing list