aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2016-10-21 10:13:42 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2016-10-21 10:13:42 +0200
commit87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e (patch)
treec0d13564029955028694eb7924c7ea37b164ce92 /id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java
parentf4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39 (diff)
downloadmoa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.tar.gz
moa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.tar.bz2
moa-id-spss-87be1b91493b0b5f4a03f049dfa99f7ba3c6f35e.zip
update ConfigTool to support more than one ELGA mandate-service
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java113
1 files changed, 113 insertions, 0 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java
index d0232e86a..225f85462 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java
@@ -29,8 +29,11 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
+import org.apache.log4j.Logger;
+
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.AuthComponentOA;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.BKUURLS;
+import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.MOAIDConfiguration;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.MOAKeyBoxSelector;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.Mandates;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.OnlineApplication;
@@ -38,7 +41,10 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TemplateType;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TemplatesType;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TestCredentials;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TransformsInfoType;
+import at.gv.egovernment.moa.id.commons.utils.KeyValueUtils;
+import at.gv.egovernment.moa.id.config.webgui.exception.ConfigurationException;
import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser;
+import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.configuration.validation.oa.OAAuthenticationDataValidation;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -48,6 +54,8 @@ import at.gv.egovernment.moa.util.MiscUtil;
*/
public class OAAuthenticationData implements IOnlineApplicationData {
+ private static final Logger log = Logger.getLogger(OAAuthenticationData.class);
+
private String bkuOnlineURL = null;
private String bkuHandyURL = null;
private String bkuLocalURL = null;
@@ -55,6 +63,13 @@ public class OAAuthenticationData implements IOnlineApplicationData {
private String mandateProfiles = null;
private boolean useMandates = false;
+ private List<String> misServicesList = null;
+ private List<String> elgaServicesList = null;
+ private List<String> szrgwServicesList = null;
+ private String misServiceSelected = null;
+ private String elgaServiceSelected = null;
+ private String szrgwServiceSelected = null;
+
private boolean calculateHPI = false;
private String keyBoxIdentifier = null;
@@ -82,6 +97,26 @@ public class OAAuthenticationData implements IOnlineApplicationData {
keyBoxIdentifier = MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR.value();
+
+ try {
+ MOAIDConfiguration dbconfig = ConfigurationProvider.getInstance().getDbRead().getMOAIDConfiguration();
+ elgaServicesList = KeyValueUtils.getListOfCSVValues(dbconfig.getElgaMandateServiceURLs());
+
+ try {
+ misServicesList = KeyValueUtils.getListOfCSVValues(
+ dbconfig.getAuthComponentGeneral().getOnlineMandates().getConnectionParameter().getURL());
+ } catch (NullPointerException e) {}
+
+ try {
+ szrgwServicesList = KeyValueUtils.getListOfCSVValues(
+ dbconfig.getAuthComponentGeneral().getForeignIdentities().getConnectionParameter().getURL());
+ } catch (NullPointerException e) {}
+
+ } catch (ConfigurationException e) {
+ log.error("MOA-ID-Configuration initialization FAILED.", e);
+
+ }
+
// bkuLocalURL = Constants.DEFAULT_LOCALBKU_URL;
// bkuHandyURL = Constants.DEFAULT_HANDYBKU_URL;
//
@@ -111,6 +146,8 @@ public class OAAuthenticationData implements IOnlineApplicationData {
public List<String> parse(OnlineApplication dbOA, AuthenticatedUser authUser, HttpServletRequest request) {
keyBoxIdentifier = dbOA.getKeyBoxIdentifier().value();
+ szrgwServiceSelected = dbOA.getSelectedSZRGWServiceURL();
+
AuthComponentOA oaauth = dbOA.getAuthComponentOA();
if (oaauth != null) {
BKUURLS bkuurls = oaauth.getBKUURLS();
@@ -177,6 +214,9 @@ public class OAAuthenticationData implements IOnlineApplicationData {
else
useMandates = false;
+ misServiceSelected = mandates.getSelectedMISServiceURL();
+ elgaServiceSelected = mandates.getSelecteELGAServiceURL();
+
}
TemplatesType templates = oaauth.getTemplates();
@@ -231,6 +271,9 @@ public class OAAuthenticationData implements IOnlineApplicationData {
dbOA.setCalculateHPI(isCalculateHPI());
+ if (MiscUtil.isNotEmpty(getSzrgwServiceSelected()))
+ dbOA.setSelectedSZRGWServiceURL(getSzrgwServiceSelected());
+
if (authUser.isAdmin()) {
//store BKU-URLs
@@ -301,9 +344,16 @@ public class OAAuthenticationData implements IOnlineApplicationData {
mandates.setProfiles(null);
+ if (MiscUtil.isNotEmpty(getMisServiceSelected()))
+ mandates.setSelectedMISServiceURL(getMisServiceSelected());
+
+ if (MiscUtil.isNotEmpty(getElgaServiceSelected()))
+ mandates.setSelecteELGAServiceURL(getElgaServiceSelected());
+
} else {
mandates.setProfiles(null);
mandates.getProfileName().clear();
+
}
authoa.setMandates(mandates);
@@ -655,6 +705,69 @@ public class OAAuthenticationData implements IOnlineApplicationData {
boolean useTestAuthblockValidationTrustStore) {
this.useTestAuthblockValidationTrustStore = useTestAuthblockValidationTrustStore;
}
+
+ /**
+ * @return the misServiceSelected
+ */
+ public String getMisServiceSelected() {
+ return misServiceSelected;
+ }
+
+ /**
+ * @param misServiceSelected the misServiceSelected to set
+ */
+ public void setMisServiceSelected(String misServiceSelected) {
+ this.misServiceSelected = misServiceSelected;
+ }
+
+ /**
+ * @return the elgaServiceSelected
+ */
+ public String getElgaServiceSelected() {
+ return elgaServiceSelected;
+ }
+
+ /**
+ * @param elgaServiceSelected the elgaServiceSelected to set
+ */
+ public void setElgaServiceSelected(String elgaServiceSelected) {
+ this.elgaServiceSelected = elgaServiceSelected;
+ }
+
+ /**
+ * @return the szrgwServiceSelected
+ */
+ public String getSzrgwServiceSelected() {
+ return szrgwServiceSelected;
+ }
+
+ /**
+ * @param szrgwServiceSelected the szrgwServiceSelected to set
+ */
+ public void setSzrgwServiceSelected(String szrgwServiceSelected) {
+ this.szrgwServiceSelected = szrgwServiceSelected;
+ }
+
+ /**
+ * @return the misServicesList
+ */
+ public List<String> getMisServicesList() {
+ return misServicesList;
+ }
+
+ /**
+ * @return the elgaServicesList
+ */
+ public List<String> getElgaServicesList() {
+ return elgaServicesList;
+ }
+
+ /**
+ * @return the szrgwServicesList
+ */
+ public List<String> getSzrgwServicesList() {
+ return szrgwServicesList;
+ }
}