aboutsummaryrefslogtreecommitdiff
path: root/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data
diff options
context:
space:
mode:
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data')
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java319
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAAuthenticationData.java63
-rw-r--r--id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java13
3 files changed, 251 insertions, 144 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
index dc6e840d7..3929238f6 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/GeneralMOAIDConfig.java
@@ -55,6 +55,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TransformsInfoT
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.TrustAnchor;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.VerifyAuthBlock;
import at.gv.egovernment.moa.id.commons.db.dao.config.deprecated.VerifyIdentityLink;
+import at.gv.egovernment.moa.id.config.webgui.exception.ConfigurationException;
import at.gv.egovernment.moa.id.configuration.Constants;
import at.gv.egovernment.moa.id.configuration.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm;
@@ -88,6 +89,7 @@ public class GeneralMOAIDConfig {
private String mandateURL = null;
private String szrgwURL = null;
private String elgaMandateServiceURL = null;
+ private String eidSystemServiceURL = null;
private boolean protocolActiveSAML1 = false;
private boolean protocolActivePVP21 = true;
@@ -131,7 +133,16 @@ public class GeneralMOAIDConfig {
private String publicURLPrefix = null;
private boolean virtualPublicURLPrefixEnabled = false;
+ private boolean moaidMode = false;
+
public GeneralMOAIDConfig() {
+ try {
+ this.moaidMode = ConfigurationProvider.getInstance().isMOAIDMode();
+ } catch (ConfigurationException e) {
+ e.printStackTrace();
+
+ }
+
chainigmodelist = new HashMap<String, String>();
ChainingModeType[] values = ChainingModeType.values();
for (int i=0; i<values.length; i++) {
@@ -165,6 +176,24 @@ public class GeneralMOAIDConfig {
AuthComponentGeneral auth = config.getAuthComponentGeneral();
//get ELGA mandate service URLs from configuration
+ if (MiscUtil.isNotEmpty(config.getEidSystemServiceURLs())) {
+ if (KeyValueUtils.isCSVValueString(config.getEidSystemServiceURLs()))
+ eidSystemServiceURL = KeyValueUtils.normalizeCSVValueString(config.getEidSystemServiceURLs());
+
+ else {
+ if (config.getEidSystemServiceURLs().contains(KeyValueUtils.CSV_DELIMITER)) {
+ //remove trailing comma if exist
+ eidSystemServiceURL = config.getEidSystemServiceURLs().substring(0,
+ config.getEidSystemServiceURLs().indexOf(KeyValueUtils.CSV_DELIMITER));
+
+ } else
+ eidSystemServiceURL = config.getEidSystemServiceURLs();
+
+ }
+ }
+
+
+ //get ELGA mandate service URLs from configuration
if (MiscUtil.isNotEmpty(config.getElgaMandateServiceURLs())) {
if (KeyValueUtils.isCSVValueString(config.getElgaMandateServiceURLs()))
elgaMandateServiceURL = KeyValueUtils.normalizeCSVValueString(config.getElgaMandateServiceURLs());
@@ -184,35 +213,6 @@ public class GeneralMOAIDConfig {
if (auth != null) {
- ForeignIdentities foreign = auth.getForeignIdentities();
-
- if (foreign != null) {
- ConnectionParameterClientAuthType connect_foreign = foreign.getConnectionParameter();
- if (connect_foreign != null) {
- if (MiscUtil.isNotEmpty(connect_foreign.getURL())) {
- if (KeyValueUtils.isCSVValueString(connect_foreign.getURL()))
- szrgwURL = KeyValueUtils.normalizeCSVValueString(connect_foreign.getURL());
-
- else {
- if (connect_foreign.getURL().contains(KeyValueUtils.CSV_DELIMITER)) {
- //remove trailing comma if exist
- szrgwURL = connect_foreign.getURL().substring(0,
- connect_foreign.getURL().indexOf(KeyValueUtils.CSV_DELIMITER));
-
- } else
- szrgwURL = connect_foreign.getURL();
-
- }
-
- }
- }
-
- STORK stork = foreign.getSTORK();
- if (stork != null) {
- //TODO: add Stork config
-
- }
- }
GeneralConfiguration authgen = auth.getGeneralConfiguration();
if (authgen != null) {
@@ -239,9 +239,7 @@ public class GeneralMOAIDConfig {
} else
publicURLPrefix = tmp;
}
-
-
-
+
TimeOuts timeouts = authgen.getTimeOuts();
if (timeouts != null) {
@@ -253,56 +251,92 @@ public class GeneralMOAIDConfig {
timeoutMOASessionUpdated = String.valueOf(timeouts.getMOASessionUpdated().longValue());
}
- }
-
- MOASP moaspss = auth.getMOASP();
- if (moaspss != null) {
- ConnectionParameterClientAuthType con = moaspss.getConnectionParameter();
- if (con != null)
- moaspssURL = con.getURL();
- VerifyAuthBlock authblock = moaspss.getVerifyAuthBlock();
- if (authblock != null) {
- moaspssAuthTrustProfile = authblock.getTrustProfileID();
- moaspssAuthTrustProfileTest = authblock.getTestTrustProfileID();
-
- List<String> list = authblock.getVerifyTransformsInfoProfileID();
- if (list.size() == 1)
- moaspssAuthTransformations += list.get(0);
- else {
- for (String el : list)
- moaspssAuthTransformations += el + LINE_DELIMITER + "\n";
+
+ //deactive STORK
+ if (isMoaidMode()) {
+ ForeignIdentities foreign = auth.getForeignIdentities();
+ if (foreign != null) {
+ ConnectionParameterClientAuthType connect_foreign = foreign.getConnectionParameter();
+ if (connect_foreign != null) {
+ if (MiscUtil.isNotEmpty(connect_foreign.getURL())) {
+ if (KeyValueUtils.isCSVValueString(connect_foreign.getURL()))
+ szrgwURL = KeyValueUtils.normalizeCSVValueString(connect_foreign.getURL());
+
+ else {
+ if (connect_foreign.getURL().contains(KeyValueUtils.CSV_DELIMITER)) {
+ //remove trailing comma if exist
+ szrgwURL = connect_foreign.getURL().substring(0,
+ connect_foreign.getURL().indexOf(KeyValueUtils.CSV_DELIMITER));
+
+ } else
+ szrgwURL = connect_foreign.getURL();
+
+ }
+
+ }
+ }
+
+ STORK stork = foreign.getSTORK();
+ if (stork != null) {
+ //TODO: add Stork config
+
+ }
}
}
- VerifyIdentityLink idl = moaspss.getVerifyIdentityLink();
- if (idl != null) {
- moaspssIdlTrustProfile = idl.getTrustProfileID();
- moaspssIdlTrustProfileTest = idl.getTestTrustProfileID();
- }
}
-
- OnlineMandates mandates = auth.getOnlineMandates();
- if (mandates != null) {
- ConnectionParameterClientAuthType con = mandates.getConnectionParameter();
- if (con != null) {
- if (MiscUtil.isNotEmpty(con.getURL())) {
- if (KeyValueUtils.isCSVValueString(con.getURL()))
- mandateURL = KeyValueUtils.normalizeCSVValueString(con.getURL());
+
+ if (isMoaidMode()) {
+ MOASP moaspss = auth.getMOASP();
+ if (moaspss != null) {
+ ConnectionParameterClientAuthType con = moaspss.getConnectionParameter();
+ if (con != null)
+ moaspssURL = con.getURL();
+
+ VerifyAuthBlock authblock = moaspss.getVerifyAuthBlock();
+ if (authblock != null) {
+ moaspssAuthTrustProfile = authblock.getTrustProfileID();
+ moaspssAuthTrustProfileTest = authblock.getTestTrustProfileID();
+ List<String> list = authblock.getVerifyTransformsInfoProfileID();
+ if (list.size() == 1)
+ moaspssAuthTransformations += list.get(0);
else {
- if (con.getURL().contains(KeyValueUtils.CSV_DELIMITER)) {
- //remove trailing comma if exist
- mandateURL = con.getURL().substring(0,
- con.getURL().indexOf(KeyValueUtils.CSV_DELIMITER));
-
- } else
- mandateURL = con.getURL();
-
+ for (String el : list)
+ moaspssAuthTransformations += el + LINE_DELIMITER + "\n";
}
+ }
+ VerifyIdentityLink idl = moaspss.getVerifyIdentityLink();
+ if (idl != null) {
+ moaspssIdlTrustProfile = idl.getTrustProfileID();
+ moaspssIdlTrustProfileTest = idl.getTestTrustProfileID();
+ }
+ }
+
+ OnlineMandates mandates = auth.getOnlineMandates();
+ if (mandates != null) {
+ ConnectionParameterClientAuthType con = mandates.getConnectionParameter();
+ if (con != null) {
+ if (MiscUtil.isNotEmpty(con.getURL())) {
+ if (KeyValueUtils.isCSVValueString(con.getURL()))
+ mandateURL = KeyValueUtils.normalizeCSVValueString(con.getURL());
+
+ else {
+ if (con.getURL().contains(KeyValueUtils.CSV_DELIMITER)) {
+ //remove trailing comma if exist
+ mandateURL = con.getURL().substring(0,
+ con.getURL().indexOf(KeyValueUtils.CSV_DELIMITER));
+
+ } else
+ mandateURL = con.getURL();
+
+ }
+
+ }
+
}
-
}
}
@@ -330,9 +364,12 @@ public class GeneralMOAIDConfig {
}
- OAuth oauth = protocols.getOAuth();
- if (oauth != null) {
- protocolActiveOAuth = oauth.isIsActive();
+ if (isMoaidMode()) {
+ OAuth oauth = protocols.getOAuth();
+ if (oauth != null) {
+ protocolActiveOAuth = oauth.isIsActive();
+
+ }
}
@@ -361,73 +398,79 @@ public class GeneralMOAIDConfig {
pvp2OrgName = org.getName();
pvp2OrgURL = org.getURL();
}
- }
+ }
+
}
- SecurityLayer seclayer = auth.getSecurityLayer();
- if (seclayer != null) {
- List<TransformsInfoType> list = seclayer.getTransformsInfo();
+ if (isMoaidMode()) {
+ SecurityLayer seclayer = auth.getSecurityLayer();
+ if (seclayer != null) {
+ List<TransformsInfoType> list = seclayer.getTransformsInfo();
+
+ for (TransformsInfoType el : list) {
+ fileUploadFileName.add(el.getFilename());
+ }
+ }
- for (TransformsInfoType el : list) {
- fileUploadFileName.add(el.getFilename());
+ SSO sso = auth.getSSO();
+ if (sso != null) {
+ ssoFriendlyName = sso.getFriendlyName();
+
+ // IdentificationNumber idl = sso.getIdentificationNumber();
+ // if (idl != null)
+ // ssoIdentificationNumber = idl.getValue();
+
+ //INFO: only for backup
+ if (MiscUtil.isEmpty(publicURLPrefix))
+ publicURLPrefix = sso.getPublicURL();
+
+ ssoSpecialText = sso.getSpecialText();
+
+ if (MiscUtil.isNotEmpty(sso.getTarget()) &&
+ sso.getTarget().startsWith(Constants.PREFIX_WPBK)) {
+ ssoTarget = sso.getTarget().substring(Constants.PREFIX_WPBK.length()).
+ replace("+", "");
+
+ } else
+ ssoTarget = sso.getTarget();
+
}
}
- SSO sso = auth.getSSO();
- if (sso != null) {
- ssoFriendlyName = sso.getFriendlyName();
-
-// IdentificationNumber idl = sso.getIdentificationNumber();
-// if (idl != null)
-// ssoIdentificationNumber = idl.getValue();
-
- //INFO: only for backup
- if (MiscUtil.isEmpty(publicURLPrefix))
- publicURLPrefix = sso.getPublicURL();
-
- ssoSpecialText = sso.getSpecialText();
-
- if (MiscUtil.isNotEmpty(sso.getTarget()) &&
- sso.getTarget().startsWith(Constants.PREFIX_WPBK)) {
- ssoTarget = sso.getTarget().substring(Constants.PREFIX_WPBK.length()).
- replace("+", "");
+ ChainingModes modes = config.getChainingModes();
+ if (modes != null) {
+ ChainingModeType defaultmode = modes.getSystemDefaultMode();
+ if (defaultmode != null) {
- } else
- ssoTarget = sso.getTarget();
+ defaultchainigmode = defaultmode.value();
+
+ }
+ List<TrustAnchor> trustanchor = modes.getTrustAnchor();
+ if (trustanchor != null) {
+ //TODO: set addional trust anchors!!!!
+ }
}
- }
-
- ChainingModes modes = config.getChainingModes();
- if (modes != null) {
- ChainingModeType defaultmode = modes.getSystemDefaultMode();
- if (defaultmode != null) {
-
- defaultchainigmode = defaultmode.value();
-
+
+ DefaultBKUs defaultbkus = config.getDefaultBKUs();
+ if (defaultbkus != null) {
+ defaultBKUHandy = defaultbkus.getHandyBKU();
+ defaultBKULocal = defaultbkus.getLocalBKU();
+ defaultBKUOnline = defaultbkus.getOnlineBKU();
}
- List<TrustAnchor> trustanchor = modes.getTrustAnchor();
- if (trustanchor != null) {
- //TODO: set addional trust anchors!!!!
+ SLRequestTemplates slreq = config.getSLRequestTemplates();
+ if (slreq != null) {
+ SLRequestTemplateHandy = slreq.getHandyBKU();
+ SLRequestTemplateLocal = slreq.getLocalBKU();
+ SLRequestTemplateOnline = slreq.getOnlineBKU();
}
+
}
trustedCACerts = config.getTrustedCACertificates();
- DefaultBKUs defaultbkus = config.getDefaultBKUs();
- if (defaultbkus != null) {
- defaultBKUHandy = defaultbkus.getHandyBKU();
- defaultBKULocal = defaultbkus.getLocalBKU();
- defaultBKUOnline = defaultbkus.getOnlineBKU();
- }
-
- SLRequestTemplates slreq = config.getSLRequestTemplates();
- if (slreq != null) {
- SLRequestTemplateHandy = slreq.getHandyBKU();
- SLRequestTemplateLocal = slreq.getLocalBKU();
- SLRequestTemplateOnline = slreq.getOnlineBKU();
- }
+
}
}
@@ -1099,10 +1142,26 @@ public class GeneralMOAIDConfig {
this.elgaMandateServiceURL = elgaMandateServiceURL;
}
-
-
-
-
+ /**
+ * @return the eidSystemServiceURL
+ */
+ public String getEidSystemServiceURL() {
+ return eidSystemServiceURL;
+ }
+
+ public boolean isMoaidMode() {
+ return moaidMode;
+ }
+
+ /**
+ * @param eidSystemServiceURL the E-ID Service URL to set
+ */
+ public void setEidSystemServiceURL(String eidSystemServiceURL) {
+ if (MiscUtil.isNotEmpty(eidSystemServiceURL))
+ this.eidSystemServiceURL = KeyValueUtils.removeAllNewlineFromString(eidSystemServiceURL);
+ else
+ this.eidSystemServiceURL = eidSystemServiceURL;
+ }
}
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 e896bb80b..b3db074a2 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
@@ -66,9 +66,11 @@ public class OAAuthenticationData implements IOnlineApplicationData {
private List<String> misServicesList = new ArrayList<String>();
private List<String> elgaServicesList = new ArrayList<String>();
private List<String> szrgwServicesList = new ArrayList<String>();
+ private List<String> eidServicesList = new ArrayList<String>();
private String misServiceSelected = null;
private String elgaServiceSelected = null;
private String szrgwServiceSelected = null;
+ private String eidServiceSelected = null;
private boolean calculateHPI = false;
@@ -90,10 +92,20 @@ public class OAAuthenticationData implements IOnlineApplicationData {
private boolean sl20Active = false;
private String sl20EndPoints = null;
+ private boolean isMoaidMode = false;
+
/**
+ * @param isMoaidMode
*
*/
public OAAuthenticationData() {
+ try {
+ this.isMoaidMode = ConfigurationProvider.getInstance().isMOAIDMode();
+ } catch (ConfigurationException e) {
+ e.printStackTrace();
+
+ }
+
keyBoxIdentifierList = new HashMap<String, String>();
MOAKeyBoxSelector[] values = MOAKeyBoxSelector.values();
for (int i=0; i<values.length; i++) {
@@ -105,18 +117,27 @@ public class OAAuthenticationData implements IOnlineApplicationData {
try {
MOAIDConfiguration dbconfig = ConfigurationProvider.getInstance().getDbRead().getMOAIDConfiguration();
-
- try {
- elgaServicesList = KeyValueUtils.getListOfCSVValues(dbconfig.getElgaMandateServiceURLs());
- misServicesList = KeyValueUtils.getListOfCSVValues(
- dbconfig.getAuthComponentGeneral().getOnlineMandates().getConnectionParameter().getURL());
- } catch (NullPointerException e) {}
-
+
+ if (this.isMoaidMode) {
+ try {
+ elgaServicesList = KeyValueUtils.getListOfCSVValues(dbconfig.getElgaMandateServiceURLs());
+ misServicesList = KeyValueUtils.getListOfCSVValues(
+ dbconfig.getAuthComponentGeneral().getOnlineMandates().getConnectionParameter().getURL());
+ } catch (NullPointerException e) {}
+
+ try {
+ szrgwServicesList = KeyValueUtils.getListOfCSVValues(
+ dbconfig.getAuthComponentGeneral().getForeignIdentities().getConnectionParameter().getURL());
+ } catch (NullPointerException e) {}
+
+ }
+
+
try {
- szrgwServicesList = KeyValueUtils.getListOfCSVValues(
- dbconfig.getAuthComponentGeneral().getForeignIdentities().getConnectionParameter().getURL());
+ eidServicesList = KeyValueUtils.getListOfCSVValues(dbconfig.getEidSystemServiceURLs());
} catch (NullPointerException e) {}
+
} catch (ConfigurationException e) {
log.error("MOA-ID-Configuration initialization FAILED.", e);
@@ -151,7 +172,8 @@ public class OAAuthenticationData implements IOnlineApplicationData {
public List<String> parse(OnlineApplication dbOA, AuthenticatedUser authUser, HttpServletRequest request) {
keyBoxIdentifier = dbOA.getKeyBoxIdentifier().value();
- szrgwServiceSelected = dbOA.getSelectedSZRGWServiceURL();
+ szrgwServiceSelected = dbOA.getSelectedSZRGWServiceURL();
+ eidServiceSelected = dbOA.getSelectedEIDServiceURL();
AuthComponentOA oaauth = dbOA.getAuthComponentOA();
if (oaauth != null) {
@@ -302,6 +324,10 @@ public class OAAuthenticationData implements IOnlineApplicationData {
if (MiscUtil.isNotEmpty(getSzrgwServiceSelected()))
dbOA.setSelectedSZRGWServiceURL(getSzrgwServiceSelected());
+
+ if (MiscUtil.isNotEmpty(getEidServiceSelected()))
+ dbOA.setSelectedEIDServiceURL(getEidServiceSelected());
+
if (authUser.isAdmin()) {
//store BKU-URLs
@@ -800,7 +826,18 @@ public class OAAuthenticationData implements IOnlineApplicationData {
return szrgwServicesList;
}
+ public List<String> getEidServicesList() {
+ return eidServicesList;
+ }
+
+ public String getEidServiceSelected() {
+ return eidServiceSelected;
+ }
+ public void setEidServiceSelected(String eidServiceSelected) {
+ this.eidServiceSelected = eidServiceSelected;
+ }
+
public boolean isSl20Active() {
return sl20Active;
}
@@ -820,7 +857,9 @@ public class OAAuthenticationData implements IOnlineApplicationData {
else
this.sl20EndPoints = sl20EndPoints;
}
+
+ public boolean isMoaidMode() {
+ return isMoaidMode;
+ }
-
-
}
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java
index b2671302c..84516c73f 100644
--- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java
+++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OATargetConfiguration.java
@@ -61,6 +61,7 @@ public class OATargetConfiguration implements IOnlineApplicationData {
private String foreignbPKTargets = null;
private String additionalbPKTargets = null;
private boolean eidDemoActive = false;
+ private boolean eidProxyActive = false;
public OATargetConfiguration() {
targetList = TargetValidator.getListOfTargets();
@@ -187,7 +188,7 @@ public class OATargetConfiguration implements IOnlineApplicationData {
//parse 'Austrian eID mode' flag
eidDemoActive = dbOA.getIseIDDemoModeActive();
-
+ eidProxyActive = dbOA.getIseIDProxyModeActive();
return null;
}
@@ -301,6 +302,7 @@ public class OATargetConfiguration implements IOnlineApplicationData {
dbOA.setForeignbPKTargetList(getForeignbPKTargets());
dbOA.setAdditionalbPKTargetList(getAdditionalbPKTargets());
dbOA.setIseIDDemoModeActive(isEidDemoActive());
+ dbOA.setIseIDProxyModeActive(isEidProxyActive());
return null;
}
@@ -490,7 +492,14 @@ public class OATargetConfiguration implements IOnlineApplicationData {
this.eidDemoActive = eidDemoActive;
}
-
+ public boolean isEidProxyActive() {
+ return eidProxyActive;
+ }
+
+
+ public void setEidProxyActive(boolean eidProxyActive) {
+ this.eidProxyActive = eidProxyActive;
+ }