aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-02-24 11:40:49 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-02-24 11:40:49 +0100
commitf1d374bb66f3b48f2a14a8d550c4125c04dde7a8 (patch)
tree77a553d94913500e7cd3344e3b478f5181ae17dd /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
parent7ed61d2e509e73b2a91884f046bf98ba1993674c (diff)
downloadmoa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.tar.gz
moa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.tar.bz2
moa-id-spss-f1d374bb66f3b48f2a14a8d550c4125c04dde7a8.zip
* add default configuration values
* add MOA-ID-Auth publicURLPreFix as mandatory configuration value * remove ReloadConfiguration serlet * change moa-id-lib to use publicURLPreFix * update repository
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java115
1 files changed, 51 insertions, 64 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
index c0f47d781..1a3c1b0a1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java
@@ -212,6 +212,8 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
private static Date date = null;
+ private String publicURLPreFix = null;
+
/**
* Return the single instance of configuration data.
*
@@ -487,32 +489,41 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
//set TrustManagerRevocationChecking
setTrustManagerRevocationChecking();
- //set TimeOuts
- if (auth.getGeneralConfiguration() != null) {
- if (auth.getGeneralConfiguration().getTimeOuts() != null) {
-
- timeouts = new TimeOuts();
- if (auth.getGeneralConfiguration().getTimeOuts().getAssertion() == null)
- timeouts.setAssertion(new BigInteger("120"));
- else
- timeouts.setAssertion(auth.getGeneralConfiguration().getTimeOuts().getAssertion());
-
- if (auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated() == null)
- timeouts.setMOASessionCreated(new BigInteger("2700"));
- else
- timeouts.setMOASessionCreated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated());
-
- if (auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated() == null)
- timeouts.setMOASessionUpdated(new BigInteger("1200"));
- else
- timeouts.setMOASessionUpdated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated());
- }
- }
- else {
- Logger.warn("Error in MOA-ID Configuration. No TimeOuts defined.");
- throw new ConfigurationException("config.02", null);
- }
+ //set default timeouts
+ timeouts = new TimeOuts();
+ timeouts.setAssertion(new BigInteger("300"));
+ timeouts.setMOASessionCreated(new BigInteger("2700"));
+ timeouts.setMOASessionUpdated(new BigInteger("1200"));
+ //search timeouts in config
+ if (auth.getGeneralConfiguration() != null) {
+ if (auth.getGeneralConfiguration().getTimeOuts() != null) {
+ if (auth.getGeneralConfiguration().getTimeOuts().getAssertion() != null)
+ timeouts.setAssertion(auth.getGeneralConfiguration().getTimeOuts().getAssertion());
+
+ if (auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated() != null)
+ timeouts.setMOASessionCreated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated());
+
+ if (auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated() != null)
+ timeouts.setMOASessionUpdated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated());
+
+ } else {
+ Logger.info("No TimeOuts defined. Use default values");
+ }
+ }
+
+ // sets the authentication session and authentication data time outs
+ AuthenticationServer.getInstance()
+ .setSecondsSessionTimeOutCreated(timeouts.getMOASessionCreated().longValue());
+
+ AuthenticationServer.getInstance()
+ .setSecondsSessionTimeOutUpdated(timeouts.getMOASessionUpdated().longValue());
+
+ AuthenticationServer.getInstance()
+ .setSecondsAuthDataTimeOut(timeouts.getAssertion().longValue());
+
+
+
//set PVP2 general config
Protocols protocols = auth.getProtocols();
if (protocols != null) {
@@ -569,39 +580,21 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
}
//set alternativeSourceID
- if (auth.getGeneralConfiguration() != null)
+ if (auth.getGeneralConfiguration() != null) {
//TODO: can be removed in a further version, because it is moved to SAML1 config
if (MiscUtil.isEmpty(alternativesourceid))
alternativesourceid = auth.getGeneralConfiguration().getAlternativeSourceID();
-
- // sets the authentication session and authentication data time outs
- BigInteger param = auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated();
-
- if (param != null) {
- long sessionTimeOut = param.longValue();
- if (sessionTimeOut > 0)
- AuthenticationServer.getInstance()
- .setSecondsSessionTimeOutCreated(sessionTimeOut);
- }
-
- param = auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated();
- if (param != null) {
- long sessionTimeOut = param.longValue();
- if (sessionTimeOut > 0)
- AuthenticationServer.getInstance()
- .setSecondsSessionTimeOutUpdated(sessionTimeOut);
- }
-
- param = auth.getGeneralConfiguration().getTimeOuts().getAssertion();
- if (param != null) {
- long authDataTimeOut = param.longValue();
- if (authDataTimeOut > 0)
- AuthenticationServer.getInstance()
- .setSecondsAuthDataTimeOut(authDataTimeOut);
- }
-
- else {
+
+ if (MiscUtil.isNotEmpty(auth.getGeneralConfiguration().getPublicURLPreFix()))
+ publicURLPreFix = auth.getGeneralConfiguration().getPublicURLPreFix();
+
+ else {
+ Logger.error("No Public URL Prefix configured.");
+ throw new ConfigurationException("config.05", new Object[]{"Public URL Prefix"});
+ }
+
+ } else {
Logger.warn("Error in MOA-ID Configuration. No GeneralConfig defined.");
throw new ConfigurationException("config.02", null);
}
@@ -947,16 +940,6 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
return new String();
}
- public String getSSOPublicUrl() {
- if (ssoconfig!= null) {
- String url = ssoconfig.getPublicURL();
- if (MiscUtil.isEmpty(url))
- url = new String();
- return url;
- }
- return new String();
- }
-
public String getMOASessionEncryptionKey() {
String prop = props.getProperty("configuration.moasession.key");
@@ -1005,6 +988,10 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
return Boolean.valueOf(prop);
}
+ public String getPublicURLPrefix() {
+ return publicURLPreFix;
+ }
+
/**
* Retruns the STORK Configuration
* @return STORK Configuration