use of org.w3c.dom.ls.DOMImplementationLS in project ddf by codice.
the class SAMLAuthenticationToken method getCredentialsAsXMLString.
@Override
public String getCredentialsAsXMLString() {
String creds = "";
Element element = getSAMLTokenAsElement();
if (element != null) {
DOMImplementationLS lsImpl = (DOMImplementationLS) element.getOwnerDocument().getImplementation().getFeature("LS", "3.0");
if (null != lsImpl) {
LSSerializer serializer = lsImpl.createLSSerializer();
serializer.getDomConfig().setParameter("xml-declaration", //by default its true, so set it to false to get String without xml-declaration
false);
creds = serializer.writeToString(element);
}
LOGGER.trace("XML representation of SAML token: {}", creds);
}
return creds;
}
Aggregations