aboutsummaryrefslogtreecommitdiff
path: root/id/server
diff options
context:
space:
mode:
Diffstat (limited to 'id/server')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java19
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java11
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java6
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java1
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java6
6 files changed, 33 insertions, 14 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 192be5bbb..3fc59a78d 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
@@ -31,6 +31,7 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.math.BigInteger;
import java.net.MalformedURLException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
@@ -50,6 +51,7 @@ import javax.xml.bind.Unmarshaller;
import org.hibernate.cfg.Configuration;
+import at.gv.egovernment.moa.id.auth.AuthenticationServer;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead;
import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils;
@@ -425,9 +427,20 @@ public class AuthConfigurationProvider extends ConfigurationProvider {
if (auth.getGeneralConfiguration().getTimeOuts() != null) {
timeouts = new TimeOuts();
- timeouts.setAssertion(auth.getGeneralConfiguration().getTimeOuts().getAssertion());
- timeouts.setMOASessionCreated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionCreated());
- timeouts.setMOASessionUpdated(auth.getGeneralConfiguration().getTimeOuts().getMOASessionUpdated());
+ 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 {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
index 19a006982..57f6ee4f1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/OAAuthParameter.java
@@ -222,12 +222,12 @@ public List<String> getTransformsInfos() {
return false;
}
- public boolean useSSOWithoutQuestion() {
+ public boolean useSSOQuestion() {
OASSO sso = oa_auth.getOASSO();
if (sso != null)
return sso.isAuthDataFrame();
else
- return false;
+ return true;
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
index 7ec8c823e..0c5a50393 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
@@ -24,6 +24,7 @@ import org.w3c.dom.Element;
import eu.stork.vidp.messages.util.SAMLUtil;
import eu.stork.vidp.messages.util.XMLUtil;
+import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS;
@@ -345,8 +346,10 @@ public class BuildFromLegacyConfig {
//set OnlineApplications
OAAuthParameter[] onlineApplicationAuthParameters = builder.buildOnlineApplicationAuthParameters(defaultVerifyInfoboxParameters, moaSpIdentityLinkTrustProfileID);
- ArrayList<OnlineApplication> moa_oas = new ArrayList<OnlineApplication>();
- moaIDConfig.setOnlineApplication(moa_oas);
+
+ // ArrayList<OnlineApplication> moa_oas = new ArrayList<OnlineApplication>();
+// moaIDConfig.setOnlineApplication(moa_oas);
+
for (OAAuthParameter oa : onlineApplicationAuthParameters) {
OnlineApplication moa_oa = new OnlineApplication();
@@ -416,6 +419,7 @@ public class BuildFromLegacyConfig {
oa_auth.setOASSO(oa_sso);
oa_sso.setUseSSO(true);
oa_sso.setSingleLogOutURL("");
+ oa_sso.setAuthDataFrame(true);
//OA_SAML1
OASAML1 oa_saml1 = new OASAML1();
@@ -446,7 +450,8 @@ public class BuildFromLegacyConfig {
oa_pvp2.setCertificate(null);
}
- moa_oas.add(moa_oa);
+ //moa_oas.add(moa_oa);
+ ConfigurationDBUtils.save(moa_oa);
}
//removed from MOAID 2.0 config
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
index 83d12be87..2a28bcd15 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/entrypoints/DispatcherServlet.java
@@ -403,7 +403,7 @@ public class DispatcherServlet extends AuthServlet{
moasession = AuthenticationSessionStoreage.getSession(moasessionID);
//use new OAParameter
- if (!oaParam.useSSOWithoutQuestion() && !AuthenticationSessionStoreage.isAuthenticated(moasessionID)) {
+ if (oaParam.useSSOQuestion() && !AuthenticationSessionStoreage.isAuthenticated(moasessionID)) {
authmanager.sendTransmitAssertionQuestion(req, resp, protocolRequest, oaParam);
return;
}
@@ -466,8 +466,8 @@ public class DispatcherServlet extends AuthServlet{
} catch (MOAIDException ex) {
handleError(null, ex, req, resp, protocolRequestID);
} catch (Throwable e) {
- e.printStackTrace();
- resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ handleErrorNoRedirect(e.getMessage(), null, req,
+ resp);
}
finally {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
index a63276d6e..34becbd49 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/PVP2XProtocol.java
@@ -270,6 +270,7 @@ public class PVP2XProtocol implements IModulInfo, MOAIDAuthConstants {
encoder = new RedirectBinding();
}
+ //TODO: getOAURL is maybe not a valid ErrorResponse URL
encoder.encodeRespone(request, response, samlResponse, protocolRequest.getOAURL());
return true;
}
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
index d3ee1442e..c8bacb470 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
@@ -149,7 +149,7 @@ public final class ConfigurationDBUtils {
session.persist(dbo);
tx.commit();
- session.clear();
+ //session.clear();
}
return true;
@@ -176,7 +176,7 @@ public final class ConfigurationDBUtils {
tx.commit();
- session.clear();
+ //session.clear();
}
return true;
@@ -198,7 +198,7 @@ public final class ConfigurationDBUtils {
session.remove(session.contains(dbo) ? dbo : session.merge(dbo));
tx.commit();
- session.clear();
+ //session.clear();
}
return true;