diff options
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java b/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java index 945aa54fd..64cb16181 100644 --- a/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java +++ b/id.server/src/at/gv/egovernment/moa/id/auth/builder/SAMLResponseBuilder.java @@ -7,6 +7,7 @@ import org.w3c.dom.Element; import at.gv.egovernment.moa.id.BuildException; import at.gv.egovernment.moa.util.Constants; import at.gv.egovernment.moa.util.DOMUtils; +import at.gv.egovernment.moa.util.StringUtils; /** * Builder for the <code>lt;samlp:Response></code> used for passing @@ -74,8 +75,8 @@ public class SAMLResponseBuilder implements Constants { statusCode, xmlSubStatusCode, statusMessage, - removeXMLDeclaration(samlAssertion) }); - Element domResponse = DOMUtils.parseDocument(xmlResponse, true, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); + StringUtils.removeXMLDeclaration(samlAssertion) }); + Element domResponse = DOMUtils.parseDocument(xmlResponse, false, ALL_SCHEMA_LOCATIONS, null).getDocumentElement(); return domResponse; } catch (Throwable ex) { @@ -85,17 +86,6 @@ public class SAMLResponseBuilder implements Constants { ex); } } - /** - * Removes the XML declaration from an XML expression. - * @param xmlString XML expression as String - * @return XML expression, XML declaration removed - */ - private String removeXMLDeclaration(String xmlString) { - if (xmlString.startsWith("<?xml")) { - int firstElement = xmlString.indexOf("<", 1); - return xmlString.substring(firstElement); - } - else return xmlString; - } + } |