diff options
5 files changed, 108 insertions, 3 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 cb60a21a0..0e65b7dca 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 @@ -30,17 +30,16 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; 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.dao.config.AuthComponentOA; import at.gv.egovernment.moa.id.commons.db.dao.config.BKUURLS; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAKeyBoxSelector; import at.gv.egovernment.moa.id.commons.db.dao.config.Mandates; -import at.gv.egovernment.moa.id.commons.db.dao.config.MandatesProfileNameItem; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; +import at.gv.egovernment.moa.id.commons.db.dao.config.TestCredentials; import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; @@ -70,6 +69,9 @@ public class OAAuthenticationData implements IOnlineApplicationData { private Map<String, byte[]> transformations; + private boolean enableTestCredentials = false; + private List<String> testCredentialOIDs = null; + /** * */ @@ -204,6 +206,12 @@ public class OAAuthenticationData implements IOnlineApplicationData { } } + if (oaauth.getTestCredentials() != null) { + enableTestCredentials = oaauth.getTestCredentials().isEnableTestCredentials(); + testCredentialOIDs = oaauth.getTestCredentials().getCredentialOID(); + + } + return null; } @@ -305,6 +313,16 @@ public class OAAuthenticationData implements IOnlineApplicationData { } + if (enableTestCredentials) { + TestCredentials testing = authoa.getTestCredentials(); + if (testing == null) + testing = new TestCredentials(); + + testing.setEnableTestCredentials(enableTestCredentials); + testing.setCredentialOID(testCredentialOIDs); + + } + return null; } @@ -538,5 +556,51 @@ public class OAAuthenticationData implements IOnlineApplicationData { SLTemplates = new ArrayList<String>(); SLTemplates.add(sLTemplateURL3); } + + /** + * @return the enableTestCredentials + */ + public boolean isEnableTestCredentials() { + return enableTestCredentials; + } + + /** + * @param enableTestCredentials the enableTestCredentials to set + */ + public void setEnableTestCredentials(boolean enableTestCredentials) { + this.enableTestCredentials = enableTestCredentials; + } + + /** + * @return the testCredentialOIDs + */ + public String getTestCredentialOIDs() { + String value = null; + for (String el : testCredentialOIDs) { + if (value == null) + value = el; + else + value += "," + el; + + } + + return value; + } + + public List<String> getTestCredialOIDList() { + return this.testCredentialOIDs; + } + + /** + * @param testCredentialOIDs the testCredentialOIDs to set + */ + public void setTestCredentialOIDs(String testCredentialOIDs) { + String[] oidList = testCredentialOIDs.split(","); + + this.testCredentialOIDs = new ArrayList<String>(); + for (int i=0; i<oidList.length; i++) + this.testCredentialOIDs.add(oidList[i].trim()); + } + } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java index 0bbf2116d..fd40bd447 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/oa/OAAuthenticationDataValidation.java @@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; +import at.gv.egovernment.moa.id.auth.MOAIDAuthConstants; import at.gv.egovernment.moa.id.commons.validation.ValidationHelper; import at.gv.egovernment.moa.id.configuration.data.oa.OAAuthenticationData; import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; @@ -145,6 +146,17 @@ public class OAAuthenticationDataValidation { new Object[] {ValidationHelper.getPotentialCSSCharacter(true)}, request )); } } + + if (form.isEnableTestCredentials()) { + for (String el : form.getTestCredialOIDList()) { + if (!el.startsWith(MOAIDAuthConstants.TESTCREDENTIALROOTOID)) + log.warn("Test credential OID does not start with test credential root OID"); + errors.add(LanguageHelper.getErrorString("validation.general.testcredentials.oid.valid", + new Object[] {el}, request )); + } + + + } return errors; } diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties index a4e5a5d05..06c22972d 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties @@ -259,6 +259,10 @@ webpages.oaconfig.general.BKUSelection.fonttype.list=Formularschrifttypen webpages.oaconfig.general.BKUSelection.header.applet.height=Appleth\u00F6he webpages.oaconfig.general.BKUSelection.header.applet.width=Appletbreite +webpages.oaconfig.general.testing.header=Test Identitu\00E4ten +webpages.oaconfig.general.testing.usetesting=Test Identitu\00E4ten erlauben +webpages.oaconfig.general.testing.oids=OIDs f\u00FCr Test Identitu\00E4ten einschr\u00E4nken. + webpages.oaconfig.sso.header=Single Sign-On webpages.oaconfig.sso.singlelogouturl=Single Log-Out URL webpages.oaconfig.sso.useauthdataframe=Zus\u00E4tzliche Userabfrage @@ -442,6 +446,7 @@ validation.general.bkuselection.file.selected=Es kann nur EIN BKU-Selektion Temp validation.general.sendassertion.filename.valid=Der Dateiname des Send-Assertion Templates enth\u00E4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt\: {0} validation.general.sendassertion.file.valid=Das Send-Assertion Templates konnte nicht geladen werden. validation.general.sendassertion.file.selected=Es kann nur EIN Send-Assertion Template angegeben werden. +validation.general.testcredentials.oid.valid=Die Testdaten OID {0} ist ung\u00FCltig. validation.stork.cpeps.cc=CPEPS L\u00E4ndercode folgt nicht ISO 3166-2 diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties index c9f4e1eb2..cc6e98964 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_en.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_en.properties @@ -190,6 +190,10 @@ webpages.oaconfig.general.bku.sltemplate.first=SecurityLayer Template webpages.oaconfig.general.bku.sltemplate.second=SecurityLayer Template (WhiteList) webpages.oaconfig.general.bku.sltemplate.third=SecurityLayer Template (WhiteList) +webpages.oaconfig.general.testing.header=Test Credentials +webpages.oaconfig.general.testing.usetesting=Allow test credentials +webpages.oaconfig.general.testing.oids=Use special test credential OIDs + webpages.oaconfig.general.bku.delete=Remove webpages.oaconfig.general.bku.bkuselection.header=CCE-Selection Template webpages.oaconfig.general.bku.bkuselection.filename=File name @@ -440,7 +444,7 @@ validation.general.bkuselection.file.selected=Only one CCE-selection template ca validation.general.sendassertion.filename.valid=The file name of Send-Assertion Templates contains forbidden characters. The following characters are not allowed\: {0} validation.general.sendassertion.file.valid=Send-Assertion Templates could not be loaded. validation.general.sendassertion.file.selected=Only one Send-Assertion Template can be provided. - +validation.general.testcredentials.oid.valid=The OID {0} for test credentials is not a valid. validation.stork.cpeps.cc=CPEPS country code is not based on 3166-2 validation.stork.cpeps.empty=CPEPS configuration is incomplete diff --git a/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/authentication.jsp b/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/authentication.jsp index a659104ed..3dda0c0a4 100644 --- a/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/authentication.jsp +++ b/id/ConfigWebTool/src/main/webapp/jsp/snippets/OA/authentication.jsp @@ -67,6 +67,26 @@ </div> </s:if> + <div class="oa_config_block"> + <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.general.testing.header", request) %></h3> + + + <s:checkbox name="authOA.enableTestCredentials" + value="%{authOA.enableTestCredentials}" + labelposition="left" + key="webpages.oaconfig.general.testing.usetesting" + cssClass="checkbox"> + </s:checkbox> + + <s:textfield name="authOA.testCredentialOIDs" + value="%{authOA.testCredentialOIDs}" + labelposition="left" + key="webpages.oaconfig.general.testing.oids" + cssClass="textfield_long"> + </s:textfield> + </div> + + <div class="oa_config_block"> <h3><%=LanguageHelper.getGUIString("webpages.oaconfig.general.mandate.header", request) %></h3> |