aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-30 17:43:18 +0100
committerFlorian Reimair <florian.reimair@iaik.tugraz.at>2014-01-31 17:16:54 +0100
commit1c72a260e3633eb8e411992ac25fc747ec71513c (patch)
tree6dc420be7d9f23a8d67ea3b4c9587ca709b83e98
parent58b19f33806927a753d76ff2d2f79e44353b0e03 (diff)
downloadmoa-id-spss-1c72a260e3633eb8e411992ac25fc747ec71513c.tar.gz
moa-id-spss-1c72a260e3633eb8e411992ac25fc747ec71513c.tar.bz2
moa-id-spss-1c72a260e3633eb8e411992ac25fc747ec71513c.zip
fixed samlengine config loading
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java13
-rw-r--r--id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java13
2 files changed, 22 insertions, 4 deletions
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
index 9f0a88c84..4554a9586 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java
@@ -74,6 +74,7 @@ import org.slf4j.LoggerFactory;
import eu.stork.peps.auth.engine.core.CustomAttributeQuery;
import eu.stork.peps.auth.engine.core.SAMLEngineSignI;
+import eu.stork.peps.configuration.ConfigurationReader;
import eu.stork.peps.exceptions.SAMLEngineException;
@@ -159,8 +160,16 @@ public class SignSW implements SAMLEngineSignI {
throws SAMLEngineException {
InputStream fileProperties = null;
try {
- fileProperties = SignSW.class.getResourceAsStream("/"
- + fileConf);
+ // 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 += "/";
+
+ if(null != base)
+ fileProperties = new FileInputStream(base + fileConf);
+ else
+ fileProperties = SignSW.class.getResourceAsStream("/" + fileConf);
properties = new Properties();
properties.loadFromXML(fileProperties);
diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
index 2fabff7d6..b40e3f7dd 100644
--- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.java
+++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/configuration/ConfigurationCreator.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;
@@ -103,8 +104,16 @@ public final class ConfigurationCreator {
LOGGER.info("Create file configuration properties to Stork Saml Engine.");
InputStream fileEngineProp = null;
try {
- fileEngineProp = ConfigurationCreator.class
- .getResourceAsStream("/" + fileName);
+ // 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 += "/";
+
+ if(null != base)
+ fileEngineProp = new FileInputStream(base + fileName);
+ else
+ fileEngineProp = ConfigurationCreator.class.getResourceAsStream("/" + fileName);
final Properties configuration = new Properties();
configuration.loadFromXML(fileEngineProp);
return configuration;