From 5eb2500909f82759d114f910ca37393e3f8639ba Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 15:34:05 +0100 Subject: list available CPEPS countries in OA config --- .../moa/id/configuration/data/oa/OASTORKConfig.java | 11 +++++++++++ id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index d5355a421..c9d4fc2ee 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -28,6 +28,7 @@ import java.util.List; import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.commons.db.dao.config.OASTORK; import at.gv.egovernment.moa.id.commons.db.dao.config.OAStorkAttribute; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; @@ -48,6 +49,7 @@ public class OASTORKConfig { private boolean vidpEnabled = false; private List attributeProviderPlugins = new ArrayList(); private boolean requireConsent = false; + private List citizenCountries; public OASTORKConfig() { @@ -72,6 +74,11 @@ public class OASTORKConfig { // if there is no configuration available for the OA, get the default qaa level setQaa(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getQualityAuthenticationAssuranceLevel()); } + + // fetch available citizen countries + citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); + + // prepare attribute helper list attributes = new ArrayList(); @@ -153,6 +160,10 @@ public class OASTORKConfig { this.attributes = attributes; } + public List getAvailableCitizenCountries() { + return citizenCountries; + } + public List getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index d5396d06e..ac433a47a 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -388,6 +388,10 @@ name="storkOA.qaa" key="webpages.moaconfig.stork.qaa" labelposition="left" /> +

wählbare Zielländer

+ + +

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.header", request) %>

@@ -747,4 +751,4 @@ - \ No newline at end of file + -- cgit v1.2.3 From 489f9404bf0f37692946e992614c5515d1af935d Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:27:19 +0100 Subject: selection gets reported to config --- .../id/configuration/data/oa/OASTORKConfig.java | 22 +++++++++++++++++----- .../src/main/webapp/jsp/editOAGeneral.jsp | 4 +--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index c9d4fc2ee..12d7faac6 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -49,7 +49,8 @@ public class OASTORKConfig { private boolean vidpEnabled = false; private List attributeProviderPlugins = new ArrayList(); private boolean requireConsent = false; - private List citizenCountries; + private List citizenCountries; + private List enabledCitizenCountries; public OASTORKConfig() { @@ -76,9 +77,12 @@ public class OASTORKConfig { } // fetch available citizen countries - citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); - - +// citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); + citizenCountries = new ArrayList(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + citizenCountries.add(current.getCountryCode()); + } + enabledCitizenCountries = new ArrayList(citizenCountries.subList(2, 4)); // prepare attribute helper list attributes = new ArrayList(); @@ -160,10 +164,18 @@ public class OASTORKConfig { this.attributes = attributes; } - public List getAvailableCitizenCountries() { + public List getAvailableCitizenCountries() { return citizenCountries; } + public List getEnabledCitizenCountries() { + return enabledCitizenCountries; + } + + public void setEnabledCitizenCountries(List update) { + enabledCitizenCountries = update; + } + public List getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index ac433a47a..cd3eca67d 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -389,9 +389,7 @@ key="webpages.moaconfig.stork.qaa" labelposition="left" />

wählbare Zielländer

- - - +

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.header", request) %>

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.used", request) %>
-- cgit v1.2.3 From 0925ae4c43b9eddfa6815c57b4e041d48600efea Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:39:46 +0100 Subject: persist cpeps per oa config --- .../moa/id/configuration/data/oa/OASTORKConfig.java | 9 +++++++++ .../id/configuration/struts/action/EditOAAction.java | 1 + .../src/main/resources/config/moaid_config_2.0.xsd | 18 ++++++++++++------ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index 12d7faac6..482c7a13b 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -176,6 +176,15 @@ public class OASTORKConfig { enabledCitizenCountries = update; } + public List getEnabledCPEPS() { + List result = new ArrayList(); + for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { + if(enabledCitizenCountries.contains(current.getCountryCode())) + result.add(current); + } + return result; + } + public List getAvailableAttributeProviderPlugins() { return AttributeProviderFactory.getAvailablePlugins(); } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java index 78747eca6..0ff60a656 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditOAAction.java @@ -1043,6 +1043,7 @@ public class EditOAAction extends ActionSupport implements ServletRequestAware, stork.setVidpEnabled(storkOA.isVidpEnabled()); stork.setRequireConsent(storkOA.isRequireConsent()); stork.setAttributeProviders(storkOA.getAttributeProviderPlugins()); + stork.setCPEPS(storkOA.getEnabledCPEPS()); try { if (newentry) { diff --git a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd index af827210f..d7f48e51a 100644 --- a/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd +++ b/id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd @@ -884,12 +884,18 @@ - - - - - - + + + + + + + -- cgit v1.2.3 From 8e6117d85cb13bacdbf11c74340bc529155fdf53 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:40:07 +0100 Subject: read cpeps per oa config from database --- .../gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java index 482c7a13b..9eca86976 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OASTORKConfig.java @@ -77,12 +77,13 @@ public class OASTORKConfig { } // fetch available citizen countries -// citizenCountries = new ArrayList(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()); citizenCountries = new ArrayList(); for(CPEPS current : ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS()) { citizenCountries.add(current.getCountryCode()); } - enabledCitizenCountries = new ArrayList(citizenCountries.subList(2, 4)); + enabledCitizenCountries = new ArrayList(); + for(CPEPS current : config.getCPEPS()) + enabledCitizenCountries.add(current.getCountryCode()); // prepare attribute helper list attributes = new ArrayList(); -- cgit v1.2.3 From a78c899b4394ac889e9102c6314fe55207c4106a Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 16:43:15 +0100 Subject: activated translation --- id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp index cd3eca67d..ebdacc7a7 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/editOAGeneral.jsp @@ -388,7 +388,7 @@ name="storkOA.qaa" key="webpages.moaconfig.stork.qaa" labelposition="left" /> -

wählbare Zielländer

+

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.enabledcpeps", request) %>

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.header", request) %>

<%=LanguageHelper.getGUIString("webpages.oaconfig.stork.attributes.used", request) %>
-- cgit v1.2.3 From cce52b9d46fc9e9f13c388362c4ca229b7a053b1 Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Tue, 25 Mar 2014 17:06:18 +0100 Subject: incorporated settings into frontend --- .../egovernment/moa/id/auth/builder/LoginFormBuilder.java | 12 ++++++++++++ .../gv/egovernment/moa/id/config/auth/OAAuthParameter.java | 7 ++++--- .../main/resources/resources/templates/loginFormFull.html | 14 ++------------ 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java index ff3b7b170..c244b64e9 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/LoginFormBuilder.java @@ -34,6 +34,8 @@ import java.net.URISyntaxException; import org.apache.commons.io.IOUtils; +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; @@ -56,6 +58,7 @@ public class LoginFormBuilder { private static String BKU_LOCAL = "#LOCAL#"; public static String CONTEXTPATH = "#CONTEXTPATH#"; private static String MOASESSIONID = "#SESSIONID#"; + private static String PEPSLIST = "#PEPSLIST#"; private static String SERVLET = CONTEXTPATH+"/GenerateIframeTemplate"; @@ -147,6 +150,15 @@ public class LoginFormBuilder { value = value.replace(CONTEXTPATH, contextpath); value = value.replace(MOASESSIONID, moaSessionID); + if (oaParam.isShowStorkLogin()) { + String pepslist = ""; + for (CPEPS current : oaParam.getPepsList()) + // check if master config has changed... + if(ConfigurationDBRead.getMOAIDConfiguration().getAuthComponentGeneral().getForeignIdentities().getSTORK().getCPEPS().contains(current)) + pepslist += "\n"; + value = value.replace(PEPSLIST, pepslist); + } + value = FormBuildUtils.customiceLayoutBKUSelection(value, oaParam.isShowMandateCheckBox(), oaParam.isOnlyMandateAllowed(), 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 d16e85084..492770aad 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 @@ -55,6 +55,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.AttributeProviderPlugin; import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUSelectionCustomizationType; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; +import at.gv.egovernment.moa.id.commons.db.dao.config.CPEPS; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates; import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem; @@ -398,9 +399,9 @@ public byte[] getSendAssertionTemplate() { return null; } - - - +public List getPepsList() { + return new ArrayList(oa_auth.getOASTORK().getCPEPS()); +} } diff --git a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html index b9d3eafa7..ef070b8eb 100644 --- a/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html +++ b/id/server/idserverlib/src/main/resources/resources/templates/loginFormFull.html @@ -815,17 +815,7 @@

Home Country Selection

i @@ -853,4 +843,4 @@ - \ No newline at end of file + -- cgit v1.2.3