Re: Re: [OpenSAML] SAMLSignedObject.verify() failed to validate signaturevalue

1 view
Skip to first unread message

alta...@gmail.com

unread,
Mar 1, 2009, 2:40:19 PM3/1/09
to mace-open...@internet2.edu
I had a similar problem having my service provider validate my signature, and it did turn out to be an issue with serialization, as you suggested. Specifically, I had indentation turned on in my transformer. Below is the code that marshalls and transforms the XML objects into a string value with the offending line commented out:

static String xmlObjectToString(XMLObject xmlObject) throws Exception{
MarshallerFactory marshallerFactory = Configuration.getMarshallerFactory();
Marshaller marshaller = marshallerFactory.getMarshaller(xmlObject);
Element samlObjectElement = marshaller.marshall(xmlObject);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
//transformer.setOutputProperty(OutputKeys.INDENT, "yes");
StreamResult result = new StreamResult(new StringWriter());
DOMSource source = new DOMSource(samlObjectElement);
transformer.transform(source, result);
return result.getWriter().toString();
}

Reply all
Reply to author
Forward
0 new messages