From 85bcdb660aca73e87a3173350b66bcdef558d287 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 21 Jun 2016 14:15:26 +0200 Subject: fix Bug in 'parse document from input stream' method which produce a SaxParserException if DebugLevel is 'debug' --- .../src/main/java/at/gv/egovernment/moa/util/DOMUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java index 95cd63643..fed968443 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/util/DOMUtils.java @@ -49,6 +49,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.apache.commons.io.IOUtils; import org.apache.xerces.parsers.DOMParser; import org.apache.xerces.parsers.SAXParser; import org.apache.xerces.parsers.XMLGrammarPreparser; @@ -225,12 +226,13 @@ public class DOMUtils { byte buffer [] = null; ByteArrayInputStream baStream = null; if(true == Logger.isDebugEnabled()) { - int len = inputStream.available(); - buffer = new byte[len]; - inputStream.read(buffer); + buffer = IOUtils.toByteArray(inputStream); baStream = new ByteArrayInputStream(buffer); - } + } + + + // create the DOM parser if (symbolTable != null) { parser = new DOMParser(symbolTable, grammarPool); @@ -298,7 +300,7 @@ public class DOMUtils { else parser.parse(new InputSource(inputStream)); } catch(SAXException e) { - if(true == Logger.isDebugEnabled() && null != buffer) { + if(true == Logger.isDebugEnabled() && null != buffer) { String xmlContent = new String(buffer); Logger.debug("SAXException in:\n" + xmlContent); } -- cgit v1.2.3 From 5d11ae1d5062c6770d4af9c573e0e1cdcb86cef2 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 30 May 2016 13:11:16 +0200 Subject: fix problem with MOA-ID-configuration GUI and SecurityLayer Templates in legacy mode --- .../moa/id/commons/config/ConfigurationMigrationUtils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'id/server') diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java index fb2ef456c..a221d30e4 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/config/ConfigurationMigrationUtils.java @@ -239,17 +239,20 @@ public class ConfigurationMigrationUtils { if (templates != null) { List templatetype = templates.getTemplate(); if (templatetype != null) { - if (templatetype.size() > 0) { + if (templatetype.size() > 0 && + MiscUtil.isNotEmpty(templatetype.get(0).getURL())) { result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_FIRST_VALUE, templatetype.get(0).getURL()); result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY, Boolean.TRUE.toString()); } else result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_LEGACY, Boolean.FALSE.toString()); - if (templatetype.size() > 1) + if (templatetype.size() > 1 && + MiscUtil.isNotEmpty(templatetype.get(1).getURL())) result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_SECOND_VALUE, templatetype.get(1).getURL()); - if (templatetype.size() > 2) + if (templatetype.size() > 2 && + MiscUtil.isNotEmpty(templatetype.get(2).getURL())) result.put(MOAIDConfigurationConstants.SERVICE_AUTH_BKU_TEMPLATE_THIRD_VALUE, templatetype.get(2).getURL()); } -- cgit v1.2.3 From d5a95646436c3f15d6ab45d0c4e75d091f8ccd87 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 7 Jun 2016 13:07:10 +0200 Subject: update handbook --- id/server/doc/handbook/application/application.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/doc/handbook/application/application.html b/id/server/doc/handbook/application/application.html index 5fadafd9a..60732acaf 100644 --- a/id/server/doc/handbook/application/application.html +++ b/id/server/doc/handbook/application/application.html @@ -129,7 +129,7 @@ https://<host>:<port>/moa-id-oa/ general.login.pvp2.idp.metadata.entityID - https://demo.egiz.gv.at/moa-id-auth/ + https://demo.egiz.gv.at/moa-id-auth/pvp2/metadata EntityID des IDP in den Metadaten (Details siehe PVP2.1 Spezifikation) -- cgit v1.2.3 From c2a94e41e4e0612314c26226a004234d71461362 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 15 Sep 2016 08:18:42 +0200 Subject: Fix bug in PVP2 Error Response (wrong EntityID) --- .../java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'id/server') diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java index bca080ba6..350690f82 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java @@ -435,7 +435,8 @@ public class PVP2XProtocol extends AbstractAuthProtocolModulController { samlResponse.setIssueInstant(new DateTime()); Issuer nissuer = SAML2Utils.createSAMLObject(Issuer.class); - nissuer.setValue(pvpRequest.getAuthURLWithOutSlash()); + nissuer.setValue(PVPConfiguration.getInstance().getIDPSSOMetadataService( + pvpRequest.getAuthURL())); nissuer.setFormat(NameID.ENTITY); samlResponse.setIssuer(nissuer); -- cgit v1.2.3