aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorAlexander Marsalek <amarsalek@iaik.tugraz.at>2014-06-11 10:20:39 +0200
committerAlexander Marsalek <amarsalek@iaik.tugraz.at>2014-06-11 10:26:35 +0200
commit1b30ac3a6862a0a07997be6216dd05d34757d504 (patch)
tree132c56b614ce3cf15b641d44620e5a81eca9303f /id
parentc976cab32c983d14efde49fd8ef5630d75e23ebe (diff)
downloadmoa-id-spss-1b30ac3a6862a0a07997be6216dd05d34757d504.tar.gz
moa-id-spss-1b30ac3a6862a0a07997be6216dd05d34757d504.tar.bz2
moa-id-spss-1b30ac3a6862a0a07997be6216dd05d34757d504.zip
loading dtlUrl from config file, adapted config file values
Diffstat (limited to 'id')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java16
1 files changed, 14 insertions, 2 deletions
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();