KEYCLOAK-5115 (#4272)

This commit is contained in:
hmlnarik 2017-06-29 15:50:50 +02:00 committed by Stian Thorgersen
parent 6ba3687b76
commit b4ad69b841
2 changed files with 3 additions and 4 deletions

View file

@ -34,6 +34,7 @@ import org.keycloak.common.util.MultivaluedHashMap;
import org.keycloak.saml.common.constants.JBossSAMLConstants; import org.keycloak.saml.common.constants.JBossSAMLConstants;
import org.keycloak.saml.common.constants.JBossSAMLURIConstants; import org.keycloak.saml.common.constants.JBossSAMLURIConstants;
import org.keycloak.saml.common.exceptions.ParsingException; import org.keycloak.saml.common.exceptions.ParsingException;
import org.keycloak.saml.common.util.DocumentUtil;
import org.keycloak.saml.processing.core.util.NamespaceContext; import org.keycloak.saml.processing.core.util.NamespaceContext;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -65,9 +66,7 @@ public class SamlDescriptorIDPKeysExtractor {
MultivaluedHashMap<String, KeyInfo> res = new MultivaluedHashMap<>(); MultivaluedHashMap<String, KeyInfo> res = new MultivaluedHashMap<>();
try { try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = DocumentUtil.getDocumentBuilder();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse(stream); Document doc = builder.parse(stream);
XPathExpression expr = xpath.compile("/m:EntitiesDescriptor/m:EntityDescriptor/m:IDPSSODescriptor/m:KeyDescriptor"); XPathExpression expr = xpath.compile("/m:EntitiesDescriptor/m:EntityDescriptor/m:IDPSSODescriptor/m:KeyDescriptor");

View file

@ -511,7 +511,7 @@ public class DocumentUtil {
}; };
private static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException {
DocumentBuilder res = XML_DOCUMENT_BUILDER.get(); DocumentBuilder res = XML_DOCUMENT_BUILDER.get();
res.reset(); res.reset();
return res; return res;