diff options
Diffstat (limited to 'id/server/idserverlib')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/attributeproviders/SignedDocAttributeRequestProvider.java | 16 |
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(); |