diff options
Diffstat (limited to 'id/ConfigWebTool/src/main/java/at/gv')
6 files changed, 89 insertions, 58 deletions
diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java index c4db5a76d..fdd566888 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/config/ConfigurationProvider.java @@ -128,6 +128,8 @@ public class ConfigurationProvider { UserRequestCleaner.start(); + log.info("MOA-ID-Configuration initialization completed"); + } catch (FileNotFoundException e) { throw new ConfigurationException("config.01", e); 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 f56ad4604..08ea9f233 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 @@ -70,7 +70,7 @@ public class GeneralMOAIDConfig { private String szrgwURL = null; private String alternativeSourceID = null; private String certStoreDirectory = null; - private boolean trustmanagerrevocationcheck = false; + private boolean trustmanagerrevocationcheck = true; private String timeoutAssertion = String.valueOf(DEFAULTTIMEOUTASSERTION); private String timeoutMOASessionCreated = String.valueOf(DEFAULTTIMEOUTMOASESSIONCREATED); @@ -93,7 +93,6 @@ public class GeneralMOAIDConfig { private String saml1SourceID = null; - private String pvp2PublicUrlPrefix = null; private String pvp2IssuerName = null; private String pvp2OrgName = null; private String pvp2OrgDisplayName = null; @@ -107,7 +106,6 @@ public class GeneralMOAIDConfig { private String ssoTarget = null; private String ssoFriendlyName = null; - private String ssoPublicUrl = null; private String ssoSpecialText = null; private String ssoIdentificationNumber = null; @@ -125,6 +123,8 @@ public class GeneralMOAIDConfig { private String SLRequestTemplateLocal = ""; private String SLRequestTemplateHandy = ""; + private String publicURLPrefix = null; + public GeneralMOAIDConfig() { chainigmodelist = new HashMap<String, String>(); ChainingModeType[] values = ChainingModeType.values(); @@ -160,6 +160,8 @@ public class GeneralMOAIDConfig { certStoreDirectory = authgen.getCertStoreDirectory(); trustmanagerrevocationcheck = authgen.isTrustManagerRevocationChecking(); + publicURLPrefix = authgen.getPublicURLPreFix(); + TimeOuts timeouts = authgen.getTimeOuts(); if (timeouts != null) { @@ -237,7 +239,10 @@ public class GeneralMOAIDConfig { protocolActivePVP21 = pvp2.isIsActive(); - pvp2PublicUrlPrefix = pvp2.getPublicURLPrefix(); + //INFO: only for backup + if (MiscUtil.isEmpty(publicURLPrefix)) + publicURLPrefix = pvp2.getPublicURLPrefix(); + pvp2IssuerName = pvp2.getIssuerName(); List<Contact> con = pvp2.getContact(); @@ -276,7 +281,10 @@ public class GeneralMOAIDConfig { // if (idl != null) // ssoIdentificationNumber = idl.getValue(); - ssoPublicUrl = sso.getPublicURL(); + //INFO: only for backup + if (MiscUtil.isEmpty(publicURLPrefix)) + publicURLPrefix = sso.getPublicURL(); + ssoSpecialText = sso.getSpecialText(); if (MiscUtil.isNotEmpty(sso.getTarget()) && @@ -491,20 +499,6 @@ public class GeneralMOAIDConfig { } /** - * @return the pvp2PublicUrlPrefix - */ - public String getPvp2PublicUrlPrefix() { - return pvp2PublicUrlPrefix; - } - - /** - * @param pvp2PublicUrlPrefix the pvp2PublicUrlPrefix to set - */ - public void setPvp2PublicUrlPrefix(String pvp2PublicUrlPrefix) { - this.pvp2PublicUrlPrefix = pvp2PublicUrlPrefix; - } - - /** * @return the pvp2IssuerName */ public String getPvp2IssuerName() { @@ -645,20 +639,6 @@ public class GeneralMOAIDConfig { } /** - * @return the ssoPublicUrl - */ - public String getSsoPublicUrl() { - return ssoPublicUrl; - } - - /** - * @param ssoPublicUrl the ssoPublicUrl to set - */ - public void setSsoPublicUrl(String ssoPublicUrl) { - this.ssoPublicUrl = ssoPublicUrl; - } - - /** * @return the ssoSpecialText */ public String getSsoSpecialText() { @@ -930,6 +910,21 @@ public class GeneralMOAIDConfig { public void setSaml1SourceID(String saml1SourceID) { this.saml1SourceID = saml1SourceID; } + + /** + * @return the publicURLPrefix + */ + public String getPublicURLPrefix() { + return publicURLPrefix; + } + + /** + * @param publicURLPrefix the publicURLPrefix to set + */ + public void setPublicURLPrefix(String publicURLPrefix) { + this.publicURLPrefix = publicURLPrefix; + } + diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java index 079e6807e..ba58701fc 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/oa/OAGeneralConfig.java @@ -107,6 +107,8 @@ public class OAGeneralConfig { keyBoxIdentifierList.put(values[i].value(), values[i].value()); } + keyBoxIdentifier = MOAKeyBoxSelector.SECURE_SIGNATURE_KEYPAIR.value(); + bkuLocalURL = Constants.DEFAULT_LOCALBKU_URL; bkuHandyURL = Constants.DEFAULT_HANDYBKU_URL; diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java index 5dccf965d..989641f36 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/EditGeneralConfigAction.java @@ -43,7 +43,6 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; import at.gv.egovernment.moa.id.commons.db.dao.config.DefaultBKUs; import at.gv.egovernment.moa.id.commons.db.dao.config.ForeignIdentities; import at.gv.egovernment.moa.id.commons.db.dao.config.GeneralConfiguration; -import at.gv.egovernment.moa.id.commons.db.dao.config.IdentificationNumber; import at.gv.egovernment.moa.id.commons.db.dao.config.IdentityLinkSigners; import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; @@ -247,9 +246,17 @@ public class EditGeneralConfigAction extends ActionSupport dbauth.setGeneralConfiguration(dbauthgeneral); } - GeneralConfiguration oldauthgeneral = null; - if (oldauth != null) - oldauthgeneral = oldauth.getGeneralConfiguration(); +// GeneralConfiguration oldauthgeneral = null; +// if (oldauth != null) +// oldauthgeneral = oldauth.getGeneralConfiguration(); + + //set Public URL Prefix + String pubURLPrefix = moaconfig.getPublicURLPrefix(); + if(pubURLPrefix.endsWith("/")) { + int length = pubURLPrefix.length(); + pubURLPrefix = pubURLPrefix.substring(0, length-1); + } + dbauthgeneral.setPublicURLPreFix(pubURLPrefix); // if (MiscUtil.isNotEmpty(moaconfig.getAlternativeSourceID())) // dbauthgeneral.setAlternativeSourceID(moaconfig.getAlternativeSourceID()); @@ -336,8 +343,8 @@ public class EditGeneralConfigAction extends ActionSupport if (MiscUtil.isNotEmpty(moaconfig.getPvp2IssuerName())) pvp2.setIssuerName(moaconfig.getPvp2IssuerName()); - if (MiscUtil.isNotEmpty(moaconfig.getPvp2PublicUrlPrefix())) - pvp2.setPublicURLPrefix(moaconfig.getPvp2PublicUrlPrefix()); +// if (MiscUtil.isNotEmpty(moaconfig.getPvp2PublicUrlPrefix())) +// pvp2.setPublicURLPrefix(moaconfig.getPvp2PublicUrlPrefix()); Organization pvp2org = pvp2.getOrganization(); if (pvp2org == null) { @@ -385,8 +392,8 @@ public class EditGeneralConfigAction extends ActionSupport dbsso.setFriendlyName(moaconfig.getSsoFriendlyName()); if (MiscUtil.isNotEmpty(moaconfig.getSsoSpecialText())) dbsso.setSpecialText(moaconfig.getSsoSpecialText()); - if (MiscUtil.isNotEmpty(moaconfig.getSsoPublicUrl())) - dbsso.setPublicURL(moaconfig.getSsoPublicUrl()); +// if (MiscUtil.isNotEmpty(moaconfig.getSsoPublicUrl())) +// dbsso.setPublicURL(moaconfig.getSsoPublicUrl()); if (MiscUtil.isNotEmpty(moaconfig.getSsoTarget())) { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java index b0e4804a8..a95d967bb 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/ValidationHelper.java @@ -167,23 +167,37 @@ public class ValidationHelper { } - public static boolean validateURL(String urlString) { log.debug("Validate URL " + urlString); - //if (urlString.startsWith("http") || urlString.startsWith("https")) { + if (urlString.startsWith("http") || urlString.startsWith("https")) { try { new URL(urlString); return true; } catch (MalformedURLException e) { } - //} + } return false; } +// public static boolean validateGeneralURL(String urlString) { +// +// log.debug("Validate URL " + urlString); +// +// try { +// new URL(urlString); +// return true; +// +// } catch (MalformedURLException e) { +// +// } +// +// return false; +// } + public static boolean isValidAdminTarget(String target) { log.debug("Ueberpruefe Parameter Target"); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java index 1c7da7079..fcf74a534 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java @@ -62,6 +62,17 @@ public class MOAConfigValidator { } } + check = form.getPublicURLPrefix(); + if (MiscUtil.isNotEmpty(check)) { + if (!ValidationHelper.validateURL(check)) { + log.info("Public URL Prefix is not valid"); + errors.add(LanguageHelper.getErrorString("validation.general.publicURLprefix.valid")); + } + } else { + log.info("PublicURL Prefix is empty."); + errors.add(LanguageHelper.getErrorString("validation.general.publicURLprefix.empty")); + } + check = form.getTimeoutAssertion(); if (MiscUtil.isNotEmpty(check)) { if (!ValidationHelper.validateNumber(check)) { @@ -234,13 +245,13 @@ public class MOAConfigValidator { } } - check = form.getPvp2PublicUrlPrefix(); - if (MiscUtil.isNotEmpty(check)) { - if (!ValidationHelper.validateURL(check)) { - log.info("PVP2 Service URL is not valid"); - errors.add(LanguageHelper.getErrorString("validation.general.protocol.pvp2.serviceurl.valid")); - } - } +// check = form.getPvp2PublicUrlPrefix(); +// if (MiscUtil.isNotEmpty(check)) { +// if (!ValidationHelper.validateURL(check)) { +// log.info("PVP2 Service URL is not valid"); +// errors.add(LanguageHelper.getErrorString("validation.general.protocol.pvp2.serviceurl.valid")); +// } +// } check = form.getSLRequestTemplateHandy(); if (MiscUtil.isEmpty(check)) { @@ -293,13 +304,13 @@ public class MOAConfigValidator { // } // } - check = form.getSsoPublicUrl(); - if (MiscUtil.isNotEmpty(check)) { - if (!ValidationHelper.validateURL(check)) { - log.info("SSO Public URL is not valid"); - errors.add(LanguageHelper.getErrorString("validation.general.sso.publicurl.valid")); - } - } +// check = form.getSsoPublicUrl(); +// if (MiscUtil.isNotEmpty(check)) { +// if (!ValidationHelper.validateURL(check)) { +// log.info("SSO Public URL is not valid"); +// errors.add(LanguageHelper.getErrorString("validation.general.sso.publicurl.valid")); +// } +// } check = form.getSsoSpecialText(); if (MiscUtil.isNotEmpty(check)) { |