From 3345275ad40fefb928908199b666d959bf5fb362 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 9 Sep 2013 11:18:26 +0200 Subject: Some short changes and bugfixes --- .../moa/id/auth/AuthenticationServer.java | 6 +-- .../servlet/VerifyAuthenticationBlockServlet.java | 7 ++- .../id/auth/servlet/VerifyIdentityLinkServlet.java | 5 -- .../moa/id/config/auth/AuthConfigLoader.java | 1 - .../id/config/auth/AuthConfigurationProvider.java | 53 +++++++++++++--------- .../moa/id/entrypoints/DispatcherServlet.java | 2 +- 6 files changed, 42 insertions(+), 32 deletions(-) (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment') 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 1bd9205ca..a19ac724e 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 @@ -586,9 +586,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { VerifyXMLSignatureResponse verifyXMLSignatureResponse = new VerifyXMLSignatureResponseParser( domVerifyXMLSignatureResponse).parseData(); - if (identityLink.getIdentificationType().equalsIgnoreCase( - Constants.URN_PREFIX_BASEID)) { - } +// if (identityLink.getIdentificationType().equalsIgnoreCase( +// Constants.URN_PREFIX_BASEID)) { +// } OAAuthParameter oaParam = AuthConfigurationProvider.getInstance() .getOnlineApplicationParameter(session.getPublicOAURLPrefix()); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java index 09e4e957d..be5dbb96a 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyAuthenticationBlockServlet.java @@ -147,6 +147,7 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { { Logger.error("Parsing mulitpart/form-data request parameters failed: " + e.getMessage()); throw new IOException(e.getMessage()); + } String sessionID = req.getParameter(PARAM_SESSIONID); String createXMLSignatureResponse = (String)parameters.get(PARAM_XMLRESPONSE); @@ -187,11 +188,15 @@ public class VerifyAuthenticationBlockServlet extends AuthServlet { // redirect url // build redirect(to the GetMISSessionIdSerlvet) + + //change MOASessionID before MIS request + String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(session); + redirectURL = new DataURLBuilder().buildDataURL( session.getAuthURL(), GET_MIS_SESSIONID, - session.getSessionID()); + newMOASessionID); String oaURL = session.getOAURLRequested(); OAAuthParameter oaParam = authConf.getOnlineApplicationParameter(oaURL); diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java index 38f650a65..fcf58c0ca 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyIdentityLinkServlet.java @@ -185,11 +185,6 @@ public class VerifyIdentityLinkServlet extends AuthServlet { } else { - // @TODO: unteren InfoboxReadRequest zu, Signer-Cert auslesen (wegen Cert Abfrage auf Organwalter OID), - // nach oben verschoben vor verifyIdentityLink (da hier schon bPK berechnet, die aber f�r OW nicht in - // AUTH Block aufscheinen darf. --> D.h. verifyIdentityLink umbauen - verify und AUTH Block bauen trennen) - - //TODO: Klaus fragen ob der Teil wirklich noch benötigt wird!!!!! boolean useMandate = session.getUseMandate(); if (useMandate) { // Mandate modus diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java index 4f4ddeb6c..12ab3f871 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigLoader.java @@ -27,7 +27,6 @@ public class AuthConfigLoader implements Runnable { if (dbdate != null && dbdate.after(date)) { AuthConfigurationProvider instance = AuthConfigurationProvider.getInstance(); instance.reloadDataBaseConfig(); - date = dbdate; } } catch (Throwable e) { Logger.warn("MOA-ID Configuration is actually not loadable. Reuse old configuration.", e); 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 df303cde2..44d580b7b 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 @@ -251,9 +251,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { try { //Initial Hibernate Framework Logger.trace("Initializing Hibernate framework."); - - date = new Date(); - + //Load MOAID-2.0 properties file File propertiesFile = new File(fileName); FileInputStream fis; @@ -278,7 +276,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { Properties moaSessionProp = new Properties(); for (Object key : props.keySet()) { String propPrefix = "moasession."; - if (key.toString().startsWith(propPrefix)) { + if (key.toString().startsWith(propPrefix+"hibernate")) { String propertyName = key.toString().substring(propPrefix.length()); moaSessionProp.put(propertyName, props.get(key.toString())); } @@ -288,7 +286,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { Properties configProp = new Properties(); for (Object key : props.keySet()) { String propPrefix = "configuration."; - if (key.toString().startsWith(propPrefix)) { + if (key.toString().startsWith(propPrefix+"hibernate")) { String propertyName = key.toString().substring(propPrefix.length()); configProp.put(propertyName, props.get(key.toString())); } @@ -410,19 +408,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { Logger.warn("NO MOA-ID configuration found."); throw new ConfigurationException("config.18", null); } - - -// //TODO: only for Testing!!! -// if (MiscUtil.isNotEmpty(xmlconfigout)) { -// Logger.info("Write MOA-ID 2.x xml config into " + xmlconfig); -// JAXBContext jc = JAXBContext.newInstance("at.gv.egovernment.moa.id.commons.db.dao.config"); -// Marshaller m = jc.createMarshaller(); -// m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); -// File test = new File(xmlconfigout); -// m.marshal(moaidconfig, test); -// -// } - + //build STORK Config AuthComponentGeneral auth = getAuthComponentGeneral(); ForeignIdentities foreign = auth.getForeignIdentities(); @@ -662,6 +648,8 @@ public class AuthConfigurationProvider extends ConfigurationProvider { //close Database ConfigurationDBUtils.closeSession(); + + date = new Date(); } @@ -873,7 +861,7 @@ public class AuthConfigurationProvider extends ConfigurationProvider { } public boolean isIdentityLinkResigning() { - String prop = props.getProperty("configuration.resignidentitylink", "false"); + String prop = props.getProperty("configuration.resignidentitylink.active", "false"); if (Boolean.valueOf(prop)) return true; else @@ -881,14 +869,37 @@ public class AuthConfigurationProvider extends ConfigurationProvider { } public String getIdentityLinkResigningKey() { - String prop = props.getProperty("configuration.resignidentitylink.keygroup"); - + String prop = props.getProperty("configuration.resignidentitylink.keygroup"); if (MiscUtil.isNotEmpty(prop)) return prop; else return null; } + public boolean isMonitoringActive() { + String prop = props.getProperty("configuration.monitoring.active", "false"); + if (Boolean.valueOf(prop)) + return true; + else + return false; + } + + public String getTestIdentityLinkURL() { + String prop = props.getProperty("configuration.monitoring.test.identitylink.url"); + if (MiscUtil.isNotEmpty(prop)) + return prop; + else + return null; + } + + public boolean isAdvancedLoggingActive() { + String prop = props.getProperty("configuration.advancedlogging.active", "false"); + if (Boolean.valueOf(prop)) + return true; + else + return false; + } + /** * Retruns the STORK Configuration * @return STORK Configuration 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 d4d01d3d1..db6564d5a 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 @@ -435,7 +435,7 @@ public class DispatcherServlet extends AuthServlet{ moasessionID = (String) req.getParameter(PARAM_SESSIONID); moasession = AuthenticationSessionStoreage.getSession(moasessionID); - AuthenticationSessionStoreage.changeSessionID(moasession); + moasessionID = AuthenticationSessionStoreage.changeSessionID(moasession); } -- cgit v1.2.3