aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-29 15:13:42 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-31 17:16:10 +0100
commit85a983b556baaaa45ea79a4da232a1a72d323708 (patch)
treed7980a109ccb618b258214e8ebf7ae48e4d1c177
parent830929713b75d4cd712f1fb8a05f0ccb728f54f2 (diff)
downloadmoa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.tar.gz
moa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.tar.bz2
moa-id-spss-85a983b556baaaa45ea79a4da232a1a72d323708.zip
enhanced samlengine for floating config location
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java3
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java2
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java18
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml6
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml)0
-rw-r--r--id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml (renamed from id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml)0
6 files changed, 19 insertions, 10 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
index f19881578..204e7f724 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java
@@ -1920,11 +1920,12 @@ public class AuthenticationServer implements MOAIDAuthConstants {
authnRequest.setEIDSectorShare(true);
authnRequest.setCitizenCountryCode("LOCAL");
+// authnRequest.setCitizenCountryCode(moasession.getCcc());
Logger.debug("STORK AuthnRequest succesfully assembled.");
- STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("CONF0");
+ STORKSAMLEngine samlEngine = STORKSAMLEngine.getInstance("outgoing");
try {
authnRequest = samlEngine.generateSTORKAuthnRequest(authnRequest);
} catch (STORKSAMLEngineException e) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
index f05180932..4819b8219 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java
@@ -97,7 +97,7 @@ public class PEPSConnectorServlet extends AuthServlet {
}
//Get SAMLEngine instance
- STORKSAMLEngine engine = STORKSAMLEngine.getInstance("CONF0");
+ STORKSAMLEngine engine = STORKSAMLEngine.getInstance("outgoing");
STORKAuthnResponse authnResponse = null;
try {
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
index 9ae8bb669..e9b067e76 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationReader.java
@@ -15,6 +15,7 @@
package eu.stork.peps.configuration;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
@@ -119,8 +120,14 @@ public final class ConfigurationReader {
*/
public static Map<String, InstanceEngine> readConfiguration()
throws SAMLEngineException {
-
- LOGGER.info("Init reader: " + ENGINE_CONF_FILE);
+
+ // fetch base from system properties, give a default if there is nothing configured
+ String base = System.getProperty("eu.stork.samlengine.config.location");
+ if(null != base)
+ if(!base.endsWith("/"))
+ base += "/";
+
+ LOGGER.info("Init reader: " + base + ENGINE_CONF_FILE);
final Map<String, InstanceEngine> instanceConfs =
new HashMap<String, InstanceEngine>();
@@ -137,9 +144,10 @@ public final class ConfigurationReader {
builder = factory.newDocumentBuilder();
- engineConf = ConfigurationReader.class
- .getResourceAsStream("/" + ENGINE_CONF_FILE);
-
+ if(null != base)
+ engineConf = new FileInputStream(base + ENGINE_CONF_FILE);
+ else
+ engineConf = ConfigurationReader.class.getResourceAsStream("/" + ENGINE_CONF_FILE);
document = builder.parse(engineConf);
diff --git a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
index d9dcb34f8..48fd9adff 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SamlEngine.xml
@@ -3,10 +3,10 @@
<!-- Configuration name-->
- <instance name="CONF0">
+ <instance name="outgoing">
<!-- Configurations parameters StorkSamlEngine -->
<configuration name="SamlEngineConf">
- <parameter name="fileConfiguration" value="StorkSamlEngine_demo.xml" />
+ <parameter name="fileConfiguration" value="StorkSamlEngine_outgoing.xml" />
</configuration>
<!-- Settings module signature-->
@@ -14,7 +14,7 @@
<!-- Specific signature module -->
<parameter name="class" value="eu.stork.peps.auth.engine.core.impl.SignSW" />
<!-- Settings specific module -->
- <parameter name="fileConfiguration" value="SignModule_demo.xml" />
+ <parameter name="fileConfiguration" value="SignModule_outgoing.xml" />
</configuration>
</instance>
diff --git a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
index c7cee3af4..c7cee3af4 100644
--- a/id/server/stork2-saml-engine/src/test/resources/SignModule_demo.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/SignModule_outgoing.xml
diff --git a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml
index f8fc4f91a..f8fc4f91a 100644
--- a/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_demo.xml
+++ b/id/server/stork2-saml-engine/src/test/resources/StorkSamlEngine_outgoing.xml