From 1b30ac3a6862a0a07997be6216dd05d34757d504 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Wed, 11 Jun 2014 10:20:39 +0200 Subject: loading dtlUrl from config file, adapted config file values --- .../eu/stork/documentservice/data/docservice.properties | 7 +++++-- .../SignedDocAttributeRequestProvider.java | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/DocumentService/src/eu/stork/documentservice/data/docservice.properties b/DocumentService/src/eu/stork/documentservice/data/docservice.properties index 051738da2..1d5bf3d41 100644 --- a/DocumentService/src/eu/stork/documentservice/data/docservice.properties +++ b/DocumentService/src/eu/stork/documentservice/data/docservice.properties @@ -3,7 +3,10 @@ sql.database=storktransfer sql.user=stork sql.password=stork -peps.country=LOCAL +peps.country=AT + +#not used peps.url=http://mopsos.iaik.tugraz.at:8080/PEPS/GetDSSFileAction -docservice.url=http://mopsos.iaik.tugraz.at:8080/DocumentService/DocumentService +#docservice.url=http://mopsos.iaik.tugraz.at:8080/DocumentService/DocumentService +docservice.url=http://testvidp.buergerkarte.at/DocumentService/DocumentService \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java index ae10cc1c8..a44539402 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java @@ -9,6 +9,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Properties; import javax.activation.DataSource; import javax.servlet.http.HttpServletRequest; @@ -57,6 +58,7 @@ import eu.stork.peps.auth.commons.STORKAttrQueryRequest; import eu.stork.peps.auth.engine.STORKSAMLEngine; import eu.stork.peps.exceptions.STORKSAMLEngineException; import eu.stork.documentservice.DocumentService; +import eu.stork.documentservice.data.DatabaseConnectorMySQLImpl; /** * Forwards a signedDoc attribute request to the oasis-dss service instance */ @@ -81,7 +83,16 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { super(attributes); this.oasisDssWebFormURL = oasisDssWebFormURL; //TODO load dtlUrl from config - dtlUrl = "http://mopsos.iaik.tugraz.at:8080/DocumentService/DocumentService"; + + Properties props = new Properties(); + try { + props.load(DatabaseConnectorMySQLImpl.class.getResourceAsStream("docservice.properties")); + dtlUrl = props.getProperty("docservice.url"); + } catch (IOException e) { + dtlUrl = "http://testvidp.buergerkarte.at/DocumentService/DocumentService"; + Logger.error("Loading DTL config failed, using default value:"+dtlUrl); + e.printStackTrace(); + } } /* @@ -394,11 +405,12 @@ public class SignedDocAttributeRequestProvider extends AttributeProvider { */ private String getDocTransferRequest(String docId, String destinationUrl) throws Exception { + String spCountry = docId.substring(0, docId.indexOf("/")); final STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP"); STORKAttrQueryRequest req = new STORKAttrQueryRequest(); req.setAssertionConsumerServiceURL(dtlUrl); req.setDestination(destinationUrl); - req.setSpCountry("IS");//FIXME + req.setSpCountry(spCountry); req.setQaa(3);//TODO PersonalAttributeList pal = new PersonalAttributeList(); PersonalAttribute attr = new PersonalAttribute(); -- cgit v1.2.3