From 06fb5360df0e2c13cc3be39f38740dc61d33afa7 Mon Sep 17 00:00:00 2001 From: "harald.bratko" Date: Wed, 10 Jan 2007 15:41:07 +0000 Subject: Adapted for MOA-ID 1.4 (validating additional infoboxes). When building the SOAP response, changed validating parsing to non validating parsing because SAML attributes may include signatures having same Id attributes. git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@770 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../moa/id/auth/builder/SAMLResponseBuilder.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'id.server/src/at/gv/egovernment/moa/id/auth') 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 lt;samlp:Response> 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("