OpenSAML - Working with CDATA in attribute values and encrypting Assertions

Cantor, Scott cantor.2 at osu.edu
Fri Oct 24 18:08:40 EDT 2014


Per usual I have nothing to offer but specific things I think are wrong
that probably have nothing to do with the issue.

I would also note that this is just a terrible idea. If you want to pass
XML in XML and not just nest it explicitly for all the usual reasons, then
base64-encode it. Do not use CDATA. You certainly can't do it while
expecting to maintain any kind of XML encoding safety when it comes to
including an xml declaration saying it's UTF-8.

On 10/24/14, 5:36 PM, "Keerthi Kumar" <kreethkar01 at gmail.com> wrote:

>Element e = doc.createElement("saml2:AttributeValue");

That's wrong. You can't use DOM 1 calls, you have to use namespace-aware
APIs.

>attrValue.setDOM(e);

And my best guess is that's not workable either, but I would have expected
the eventual marshalling of the whole document to overwrite that entire
DOM, and not even include the CDATA in any form, but don't know.

Bottom line, forget using CDATA.

-- Scott



More information about the dev mailing list