From 328f850d0b5775bc8aed8f5ced1a6ef6269cb831 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 6 Aug 2013 18:53:14 +0200 Subject: - Change UserBase implementation - starts with general MOAID Config --- .../moa/id/configuration/Constants.java | 3 + .../id/configuration/data/GeneralMOAIDConfig.java | 761 ++++++++++++++++++++- .../id/configuration/data/oa/OAGeneralConfig.java | 37 +- .../id/configuration/data/pvp2/ContactForm.java | 114 +++ .../configuration/filter/AuthenticationFilter.java | 3 +- .../configuration/struts/action/EditOAAction.java | 17 +- .../configuration/struts/action/ListOAsAction.java | 29 +- .../struts/action/UserManagementAction.java | 62 ++ .../configuration/validation/ValidationHelper.java | 24 +- .../validation/moaconfig/MOAConfigValidator.java | 94 +++ .../resources/applicationResources_de.properties | 60 +- id/ConfigWebTool/src/main/resources/struts.xml | 11 +- id/ConfigWebTool/src/main/webapp/css/index.css | 13 + .../src/main/webapp/jsp/editMOAConfig.jsp | 354 ++++++++++ .../id/config/auth/AuthConfigurationProvider.java | 6 + .../id/config/legacy/BuildFromLegacyConfig.java | 10 +- .../moa/id/commons/db/ConfigurationDBRead.java | 35 +- .../moa/id/commons/db/dao/config/UserDatabase.java | 263 ------- .../id/commons/db/dao/session/OASessionStore.java | 1 - .../src/main/resources/config/moaid_config_2.0.xsd | 69 +- .../main/resources/config/persistence_template.xml | 2 +- 21 files changed, 1617 insertions(+), 351 deletions(-) create mode 100644 id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/pvp2/ContactForm.java create mode 100644 id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java create mode 100644 id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java create mode 100644 id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp delete mode 100644 id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java index 19af2876d..8ef3ec2f0 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/Constants.java @@ -20,4 +20,7 @@ public class Constants { public static final String MOA_CONFIG_BUSINESSSERVICE = "businessService"; + + public static final String MOA_CONFIG_PROTOCOL_SAML1 = "id_saml1"; + public static final String MOA_CONFIG_PROTOCOL_PVP2 = "id_pvp2x"; } 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 f0c4e3314..f03b1c057 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 @@ -1,18 +1,103 @@ package at.gv.egovernment.moa.id.configuration.data; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModeType; +import at.gv.egovernment.moa.id.commons.db.dao.config.ChainingModes; import at.gv.egovernment.moa.id.commons.db.dao.config.ConnectionParameterClientAuthType; +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.IdentityLinkSignersX509SubjectNameItem; +import at.gv.egovernment.moa.id.commons.db.dao.config.LegacyAllowed; import at.gv.egovernment.moa.id.commons.db.dao.config.MOAIDConfiguration; +import at.gv.egovernment.moa.id.commons.db.dao.config.MOASP; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineMandates; +import at.gv.egovernment.moa.id.commons.db.dao.config.Organization; +import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2; +import at.gv.egovernment.moa.id.commons.db.dao.config.Protocols; +import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates; +import at.gv.egovernment.moa.id.commons.db.dao.config.SSO; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; +import at.gv.egovernment.moa.id.commons.db.dao.config.SecurityLayer; +import at.gv.egovernment.moa.id.commons.db.dao.config.TimeOuts; +import at.gv.egovernment.moa.id.commons.db.dao.config.TransformsInfoType; +import at.gv.egovernment.moa.id.commons.db.dao.config.TrustAnchor; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyAuthBlock; +import at.gv.egovernment.moa.id.commons.db.dao.config.VerifyIdentityLink; +import at.gv.egovernment.moa.id.configuration.Constants; +import at.gv.egovernment.moa.id.configuration.data.pvp2.ContactForm; public class GeneralMOAIDConfig { + public static final String LINE_DELIMITER = ";\n"; + private String szrgwURL = null; private String alternativeSourceID = null; private String certStoreDirectory = null; + private boolean trustmanagerrevocationcheck = false; + + private long timeoutAssertion = 120; //sec + private long timeoutMOASessionCreated = 1200; //sec + private long timeoutMOASessionUpdated = 2700; //sec + + private String identityLinkSigners = ""; + + private String moaspssURL = null; + private String moaspssAuthTrustProfile = null; + private String moaspssAuthTransformations = ""; + private String moaspssIdlTrustProfile = null; + + private String mandateURL = null; + + private boolean legacy_saml1 = false; + private boolean legacy_pvp2 = false; + + private String pvp2PublicUrlPrefix = null; + private String pvp2IssuerName = null; + private String pvp2OrgName = null; + private String pvp2OrgDisplayName = null; + private String pvp2OrgURL = null; + private ContactForm pvp2Contact = null; + + private List fileUpload = null; + private List fileUploadContentType; + private List fileUploadFileName; + + private String ssoTarget = null; + private String ssoFriendlyName = null; + private String ssoPublicUrl = null; + private String ssoSpecialText = null; + private String ssoIdentificationNumber = null; + + private String defaultchainigmode = null; + private static Map chainigmodelist; + + private String trustedCACerts = null; + + private String defaultBKUOnline = ""; + private String defaultBKULocal = "https://127.0.0.1:3496/https-security-layer-request"; + private String defaultBKUHandy = "https://www.handy-signatur.at/mobile/https-security-layer-request/default.aspx"; + + private String SLRequestTemplateOnline = ""; + private String SLRequestTemplateLocal = ""; + private String SLRequestTemplateHandy = ""; + public GeneralMOAIDConfig() { + chainigmodelist = new HashMap(); + ChainingModeType[] values = ChainingModeType.values(); + for (int i=0; i idem = idlsign.getX509SubjectNameItems(); + + for (IdentityLinkSignersX509SubjectNameItem el : idem) { + identityLinkSigners += el.getItem() + LINE_DELIMITER; + } + + } + + 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(); + + List list = authblock.getVerifyTransformsInfoProfileID(); + for (String el : list) + moaspssAuthTransformations += el + LINE_DELIMITER; + } + + VerifyIdentityLink idl = moaspss.getVerifyIdentityLink(); + if (idl != null) { + moaspssIdlTrustProfile = idl.getTrustProfileID(); + } + } + + OnlineMandates mandates = auth.getOnlineMandates(); + if (mandates != null) { + ConnectionParameterClientAuthType con = mandates.getConnectionParameter(); + if (con != null) { + mandateURL = con.getURL(); + } + } + + Protocols protocols = auth.getProtocols(); + if (protocols != null) { + LegacyAllowed legacy = protocols.getLegacyAllowed(); + + if (legacy != null) { + List list = legacy.getProtocolName(); + if (list.contains(Constants.MOA_CONFIG_PROTOCOL_SAML1)) + legacy_saml1 = true; + + if (list.contains(Constants.MOA_CONFIG_PROTOCOL_PVP2)) + legacy_pvp2 = true; + } + + PVP2 pvp2 = protocols.getPVP2(); + if (pvp2 != null) { + pvp2PublicUrlPrefix = pvp2.getPublicURLPrefix(); + pvp2IssuerName = pvp2.getIssuerName(); + + List con = pvp2.getContact(); + + //TODO: change to support more contacts + if (con != null && con.size() > 0) { + pvp2Contact = new ContactForm(con.get(0)); + + } + + Organization org = pvp2.getOrganization(); + if (org != null) { + pvp2OrgDisplayName = org.getDisplayName(); + pvp2OrgName = org.getName(); + pvp2OrgURL = org.getURL(); + } + } + } + + SecurityLayer seclayer = auth.getSecurityLayer(); + if (seclayer != null) { + List list = seclayer.getTransformsInfo(); + + fileUploadFileName = new ArrayList(); + + 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(); + + ssoPublicUrl = sso.getPublicURL(); + ssoSpecialText = sso.getSpecialText(); + ssoTarget = sso.getTarget(); } } - } - + ChainingModes modes = config.getChainingModes(); + if (modes != null) { + ChainingModeType defaultmode = modes.getSystemDefaultMode(); + if (defaultmode != null) { + defaultchainigmode = defaultmode.value(); + + } + + List trustanchor = modes.getTrustAnchor(); + if (trustanchor != null) { + //TODO: set addional trust anchors!!!! + } + } + + 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(); + } + } + } + + /** + * @return the szrgwURL + */ + public String getSzrgwURL() { + return szrgwURL; + } + + /** + * @param szrgwURL the szrgwURL to set + */ + public void setSzrgwURL(String szrgwURL) { + this.szrgwURL = szrgwURL; + } + + /** + * @return the alternativeSourceID + */ + public String getAlternativeSourceID() { + return alternativeSourceID; + } + + /** + * @param alternativeSourceID the alternativeSourceID to set + */ + public void setAlternativeSourceID(String alternativeSourceID) { + this.alternativeSourceID = alternativeSourceID; + } + + /** + * @return the certStoreDirectory + */ + public String getCertStoreDirectory() { + return certStoreDirectory; + } + + /** + * @param certStoreDirectory the certStoreDirectory to set + */ + public void setCertStoreDirectory(String certStoreDirectory) { + this.certStoreDirectory = certStoreDirectory; + } + + /** + * @return the timeoutAssertion + */ + public long getTimeoutAssertion() { + return timeoutAssertion; + } + + /** + * @param timeoutAssertion the timeoutAssertion to set + */ + public void setTimeoutAssertion(long timeoutAssertion) { + this.timeoutAssertion = timeoutAssertion; + } + + /** + * @return the timeoutMOASessionCreated + */ + public long getTimeoutMOASessionCreated() { + return timeoutMOASessionCreated; + } + + /** + * @param timeoutMOASessionCreated the timeoutMOASessionCreated to set + */ + public void setTimeoutMOASessionCreated(long timeoutMOASessionCreated) { + this.timeoutMOASessionCreated = timeoutMOASessionCreated; + } + + /** + * @return the timeoutMOASessionUpdated + */ + public long getTimeoutMOASessionUpdated() { + return timeoutMOASessionUpdated; + } + + /** + * @param timeoutMOASessionUpdated the timeoutMOASessionUpdated to set + */ + public void setTimeoutMOASessionUpdated(long timeoutMOASessionUpdated) { + this.timeoutMOASessionUpdated = timeoutMOASessionUpdated; + } + + /** + * @return the identityLinkSigners + */ + public String getIdentityLinkSigners() { + return identityLinkSigners; + } + + /** + * @param identityLinkSigners the identityLinkSigners to set + */ + public void setIdentityLinkSigners(String identityLinkSigners) { + this.identityLinkSigners = identityLinkSigners; + } + + /** + * @return the moaspssURL + */ + public String getMoaspssURL() { + return moaspssURL; + } + + /** + * @param moaspssURL the moaspssURL to set + */ + public void setMoaspssURL(String moaspssURL) { + this.moaspssURL = moaspssURL; + } + + /** + * @return the moaspssAuthTrustProfile + */ + public String getMoaspssAuthTrustProfile() { + return moaspssAuthTrustProfile; + } + + /** + * @param moaspssAuthTrustProfile the moaspssAuthTrustProfile to set + */ + public void setMoaspssAuthTrustProfile(String moaspssAuthTrustProfile) { + this.moaspssAuthTrustProfile = moaspssAuthTrustProfile; + } + + /** + * @return the moaspssAuthTransformations + */ + public String getMoaspssAuthTransformations() { + return moaspssAuthTransformations; + } + + /** + * @param moaspssAuthTransformations the moaspssAuthTransformations to set + */ + public void setMoaspssAuthTransformations(String moaspssAuthTransformations) { + this.moaspssAuthTransformations = moaspssAuthTransformations; + } + + /** + * @return the moaspssIdlTrustProfile + */ + public String getMoaspssIdlTrustProfile() { + return moaspssIdlTrustProfile; + } + + /** + * @param moaspssIdlTrustProfile the moaspssIdlTrustProfile to set + */ + public void setMoaspssIdlTrustProfile(String moaspssIdlTrustProfile) { + this.moaspssIdlTrustProfile = moaspssIdlTrustProfile; + } + + /** + * @return the mandateURL + */ + public String getMandateURL() { + return mandateURL; } + + /** + * @param mandateURL the mandateURL to set + */ + public void setMandateURL(String mandateURL) { + this.mandateURL = mandateURL; + } + + /** + * @return the legacy_saml1 + */ + public boolean isLegacy_saml1() { + return legacy_saml1; + } + + /** + * @param legacy_saml1 the legacy_saml1 to set + */ + public void setLegacy_saml1(boolean legacy_saml1) { + this.legacy_saml1 = legacy_saml1; + } + + /** + * @return the legacy_pvp2 + */ + public boolean isLegacy_pvp2() { + return legacy_pvp2; + } + + /** + * @param legacy_pvp2 the legacy_pvp2 to set + */ + public void setLegacy_pvp2(boolean legacy_pvp2) { + this.legacy_pvp2 = legacy_pvp2; + } + + /** + * @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() { + return pvp2IssuerName; + } + + /** + * @param pvp2IssuerName the pvp2IssuerName to set + */ + public void setPvp2IssuerName(String pvp2IssuerName) { + this.pvp2IssuerName = pvp2IssuerName; + } + + /** + * @return the pvp2OrgName + */ + public String getPvp2OrgName() { + return pvp2OrgName; + } + + /** + * @param pvp2OrgName the pvp2OrgName to set + */ + public void setPvp2OrgName(String pvp2OrgName) { + this.pvp2OrgName = pvp2OrgName; + } + + /** + * @return the pvp2OrgDisplayName + */ + public String getPvp2OrgDisplayName() { + return pvp2OrgDisplayName; + } + + /** + * @param pvp2OrgDisplayName the pvp2OrgDisplayName to set + */ + public void setPvp2OrgDisplayName(String pvp2OrgDisplayName) { + this.pvp2OrgDisplayName = pvp2OrgDisplayName; + } + + /** + * @return the pvp2OrgURL + */ + public String getPvp2OrgURL() { + return pvp2OrgURL; + } + + /** + * @param pvp2OrgURL the pvp2OrgURL to set + */ + public void setPvp2OrgURL(String pvp2OrgURL) { + this.pvp2OrgURL = pvp2OrgURL; + } + + /** + * @return the pvp2Contact + */ + public ContactForm getPvp2Contact() { + return pvp2Contact; + } + + /** + * @param pvp2Contact the pvp2Contact to set + */ + public void setPvp2Contact(ContactForm pvp2Contact) { + this.pvp2Contact = pvp2Contact; + } + + /** + * @return the fileUpload + */ + public List getFileUpload() { + return fileUpload; + } + + /** + * @param fileUpload the fileUpload to set + */ + public void setFileUpload(List fileUpload) { + this.fileUpload = fileUpload; + } + + /** + * @return the fileUploadContentType + */ + public List getFileUploadContentType() { + return fileUploadContentType; + } + + /** + * @param fileUploadContentType the fileUploadContentType to set + */ + public void setFileUploadContentType(List fileUploadContentType) { + this.fileUploadContentType = fileUploadContentType; + } + + /** + * @return the fileUploadFileName + */ + public List getFileUploadFileName() { + return fileUploadFileName; + } + + /** + * @param fileUploadFileName the fileUploadFileName to set + */ + public void setFileUploadFileName(List fileUploadFileName) { + this.fileUploadFileName = fileUploadFileName; + } + + /** + * @return the ssoTarget + */ + public String getSsoTarget() { + return ssoTarget; + } + + /** + * @param ssoTarget the ssoTarget to set + */ + public void setSsoTarget(String ssoTarget) { + this.ssoTarget = ssoTarget; + } + + /** + * @return the ssoFriendlyName + */ + public String getSsoFriendlyName() { + return ssoFriendlyName; + } + + /** + * @param ssoFriendlyName the ssoFriendlyName to set + */ + public void setSsoFriendlyName(String ssoFriendlyName) { + this.ssoFriendlyName = ssoFriendlyName; + } + + /** + * @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() { + return ssoSpecialText; + } + + /** + * @param ssoSpecialText the ssoSpecialText to set + */ + public void setSsoSpecialText(String ssoSpecialText) { + this.ssoSpecialText = ssoSpecialText; + } + + /** + * @return the ssoIdentificationNumber + */ + public String getSsoIdentificationNumber() { + return ssoIdentificationNumber; + } + + /** + * @param ssoIdentificationNumber the ssoIdentificationNumber to set + */ + public void setSsoIdentificationNumber(String ssoIdentificationNumber) { + this.ssoIdentificationNumber = ssoIdentificationNumber; + } + + /** + * @return the defaultchainigmode + */ + public String getDefaultchainigmode() { + return defaultchainigmode; + } + + /** + * @param defaultchainigmode the defaultchainigmode to set + */ + public void setDefaultchainigmode(String defaultchainigmode) { + this.defaultchainigmode = defaultchainigmode; + } + + /** + * @return the defaultBKUOnline + */ + public String getDefaultBKUOnline() { + return defaultBKUOnline; + } + + /** + * @param defaultBKUOnline the defaultBKUOnline to set + */ + public void setDefaultBKUOnline(String defaultBKUOnline) { + this.defaultBKUOnline = defaultBKUOnline; + } + + /** + * @return the defaultBKULocal + */ + public String getDefaultBKULocal() { + return defaultBKULocal; + } + + /** + * @param defaultBKULocal the defaultBKULocal to set + */ + public void setDefaultBKULocal(String defaultBKULocal) { + this.defaultBKULocal = defaultBKULocal; + } + + /** + * @return the defaultBKUHandy + */ + public String getDefaultBKUHandy() { + return defaultBKUHandy; + } + + /** + * @param defaultBKUHandy the defaultBKUHandy to set + */ + public void setDefaultBKUHandy(String defaultBKUHandy) { + this.defaultBKUHandy = defaultBKUHandy; + } + + /** + * @return the sLRequestTemplateOnline + */ + public String getSLRequestTemplateOnline() { + return SLRequestTemplateOnline; + } + + /** + * @param sLRequestTemplateOnline the sLRequestTemplateOnline to set + */ + public void setSLRequestTemplateOnline(String sLRequestTemplateOnline) { + SLRequestTemplateOnline = sLRequestTemplateOnline; + } + + /** + * @return the sLRequestTemplateLocal + */ + public String getSLRequestTemplateLocal() { + return SLRequestTemplateLocal; + } + + /** + * @param sLRequestTemplateLocal the sLRequestTemplateLocal to set + */ + public void setSLRequestTemplateLocal(String sLRequestTemplateLocal) { + SLRequestTemplateLocal = sLRequestTemplateLocal; + } + + /** + * @return the sLRequestTemplateHandy + */ + public String getSLRequestTemplateHandy() { + return SLRequestTemplateHandy; + } + + /** + * @param sLRequestTemplateHandy the sLRequestTemplateHandy to set + */ + public void setSLRequestTemplateHandy(String sLRequestTemplateHandy) { + SLRequestTemplateHandy = sLRequestTemplateHandy; + } + + /** + * @return the trustmanagerrevocationcheck + */ + public boolean isTrustmanagerrevocationcheck() { + return trustmanagerrevocationcheck; + } + + /** + * @param trustmanagerrevocationcheck the trustmanagerrevocationcheck to set + */ + public void setTrustmanagerrevocationcheck(boolean trustmanagerrevocationcheck) { + this.trustmanagerrevocationcheck = trustmanagerrevocationcheck; + } + + /** + * @return the trustedCACerts + */ + public String getTrustedCACerts() { + return trustedCACerts; + } + + /** + * @param trustedCACerts the trustedCACerts to set + */ + public void setTrustedCACerts(String trustedCACerts) { + this.trustedCACerts = trustedCACerts; + } + + /** + * @return the chainigmodelist + */ + public Map getChainigmodelist() { + return chainigmodelist; + } + + /** + * @param chainigmodelist the chainigmodelist to set + */ + public void setChainigmodelist(Map chainigmodelist) { + GeneralMOAIDConfig.chainigmodelist = chainigmodelist; + } + + } 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 ebd1b3862..f3b513019 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 @@ -5,9 +5,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBRead; 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.IdentificationNumber; +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.OnlineApplication; @@ -15,6 +18,7 @@ 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.TransformsInfoType; import at.gv.egovernment.moa.id.configuration.Constants; +import at.gv.egovernment.moa.util.MiscUtil; public class OAGeneralConfig { @@ -86,10 +90,37 @@ public class OAGeneralConfig { AuthComponentOA oaauth = dbOAConfig.getAuthComponentOA(); if (oaauth != null) { BKUURLS bkuurls = oaauth.getBKUURLS(); + + String defaulthandy = ""; + String defaultlocal = ""; + String defaultonline = ""; + + MOAIDConfiguration dbconfig = ConfigurationDBRead.getMOAIDConfiguration(); + if (dbconfig != null) { + DefaultBKUs defaultbkus = dbconfig.getDefaultBKUs(); + if (defaultbkus != null) { + defaulthandy = defaultbkus.getHandyBKU(); + defaultlocal = defaultbkus.getLocalBKU(); + defaultonline = defaultbkus.getOnlineBKU(); + } + } + if (bkuurls != null) { - bkuHandyURL = bkuurls.getHandyBKU(); - bkuLocalURL = bkuurls.getLocalBKU(); - bkuOnlineURL = bkuurls.getOnlineBKU(); + + if (MiscUtil.isEmpty(bkuurls.getHandyBKU())) + bkuHandyURL = defaulthandy; + else + bkuHandyURL = bkuurls.getHandyBKU(); + + if (MiscUtil.isEmpty(bkuurls.getLocalBKU())) + bkuLocalURL = defaultlocal; + else + bkuLocalURL = bkuurls.getLocalBKU(); + + if (MiscUtil.isEmpty(bkuurls.getOnlineBKU())) + bkuOnlineURL = defaultonline; + else + bkuOnlineURL = bkuurls.getOnlineBKU(); } IdentificationNumber idnumber = oaauth.getIdentificationNumber(); diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/pvp2/ContactForm.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/pvp2/ContactForm.java new file mode 100644 index 000000000..fe685e6d0 --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/data/pvp2/ContactForm.java @@ -0,0 +1,114 @@ +package at.gv.egovernment.moa.id.configuration.data.pvp2; + +import java.util.ArrayList; +import java.util.List; + +import at.gv.egovernment.moa.id.commons.db.dao.config.Contact; + +public class ContactForm { + + private String surname; + private String givenname; + private List mail; + private String type; + private String company; + private List phone; + + public ContactForm() { + + } + + public ContactForm(Contact dbcont) { + this.surname = dbcont.getSurName(); + this.givenname = dbcont.getGivenName(); + this.mail =dbcont.getMail(); + this.phone = dbcont.getPhone(); + this.company = dbcont.getCompany(); + this.type = dbcont.getType(); + } + + /** + * @return the surname + */ + public String getSurname() { + return surname; + } + /** + * @param surname the surname to set + */ + public void setSurname(String surname) { + this.surname = surname; + } + /** + * @return the givenname + */ + public String getGivenname() { + return givenname; + } + /** + * @param givenname the givenname to set + */ + public void setGivenname(String givenname) { + this.givenname = givenname; + } + /** + * @return the mail + */ + public String getMail() { + if (mail.size() > 0) + return mail.get(0); + else + return null; + } + /** + * @param mail the mail to set + */ + public void setMail(String mail) { + if (this.mail == null) + this.mail = new ArrayList(); + this.mail.add(mail); + } + /** + * @return the type + */ + public String getType() { + return type; + } + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + /** + * @return the company + */ + public String getCompany() { + return company; + } + /** + * @param company the company to set + */ + public void setCompany(String company) { + this.company = company; + } + /** + * @return the phone + */ + public String getPhone() { + if (phone.size() > 0) + return phone.get(0); + else + return null; + } + /** + * @param phone the phone to set + */ + public void setPhone(String phone) { + if (this.phone == null) + this.phone = new ArrayList(); + this.phone.add(phone); + } + + +} diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java index 517786d11..4eccfdf5d 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/filter/AuthenticationFilter.java @@ -128,7 +128,8 @@ public class AuthenticationFilter implements Filter{ if (authuser == null) { - authuser = new AuthenticatedUser(0000000, "Max", "TestUser", true, true); + authuser = new AuthenticatedUser(1, "Max", "TestUser", true, true); + //authuser = new AuthenticatedUser(1, "Max", "TestUser", true, false); httpServletRequest.getSession().setAttribute(Constants.SESSION_AUTH, authuser); } 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 1c498ecc2..a9210ad27 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 @@ -24,6 +24,7 @@ import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2; import at.gv.egovernment.moa.id.commons.db.dao.config.OASAML1; import at.gv.egovernment.moa.id.commons.db.dao.config.OASSO; import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplicationType; import at.gv.egovernment.moa.id.commons.db.dao.config.STORK; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplateType; import at.gv.egovernment.moa.id.commons.db.dao.config.TemplatesType; @@ -240,6 +241,13 @@ ServletResponseAware { public String deleteOA() { + Object authUserObj = request.getSession().getAttribute(Constants.SESSION_AUTH); + + if (authUserObj != null && authUserObj instanceof AuthenticatedUser) { + authUser = (AuthenticatedUser) authUserObj; + } else + return Constants.STRUTS_REAUTHENTICATE; + String oaidentifier = generalOA.getIdentifier(); if (MiscUtil.isEmpty(oaidentifier)) { log.info("Empty OA identifier"); @@ -262,9 +270,9 @@ ServletResponseAware { if (!authUser.isAdmin()) { UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID()); - List useroas = user.getRegistratedOAs(); + List useroas = user.getOnlineApplication(); - for (OnlineApplication oa : useroas) { + for (OnlineApplicationType oa : useroas) { if (oa.getHjid().equals(onlineapplication.getHjid())) { useroas.remove(oa); } @@ -430,12 +438,13 @@ ServletResponseAware { if (!authUser.isAdmin()) { UserDatabase user = ConfigurationDBRead.getUserWithID(authUser.getUserID()); - List useroas = user.getRegistratedOAs(); + + List useroas = user.getOnlineApplication(); if (useroas == null) useroas = new ArrayList(); useroas.add(dboa); - ConfigurationDBUtils.save(user); + ConfigurationDBUtils.saveOrUpdate(user); } } diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java index 9e6e04644..deb48111d 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/ListOAsAction.java @@ -15,6 +15,7 @@ import com.opensymphony.xwork2.ActionSupport; 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.OnlineApplication; +import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplicationType; import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; import at.gv.egovernment.moa.id.configuration.Constants; import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; @@ -57,14 +58,18 @@ public class ListOAsAction extends ActionSupport implements ServletRequestAware, if (authUser.isAdmin()) { dbOAs = ConfigurationDBRead.getAllOnlineApplications(); - + } else { UserDatabase authUserDB = ConfigurationDBRead.getUserWithID(authUser.getUserID()); - dbOAs = authUserDB.getRegistratedOAs(); + + if (authUserDB != null) + dbOAs = authUserDB.getOnlineApplication(); } - addFormOAs(dbOAs); + addFormOAs(dbOAs); + ConfigurationDBUtils.closeSession(); + return Constants.STRUTS_SUCCESS; } @@ -116,12 +121,24 @@ public class ListOAsAction extends ActionSupport implements ServletRequestAware, dbOAs = ConfigurationDBRead.searchOnlineApplications(friendlyname); } else { - dbOAs = ConfigurationDBRead.searchOnlineApplicationsFromUser(authUser.getUserID(), friendlyname); - + UserDatabase authUserDB = ConfigurationDBRead.getUserWithID(authUser.getUserID()); + if (authUserDB != null) { + List alldbOAs = authUserDB.getOnlineApplication(); + + dbOAs = new ArrayList(); + + for (OnlineApplication el : alldbOAs) { + if (el.getPublicURLPrefix() + .toLowerCase().indexOf(friendlyname.toLowerCase()) > -1) + dbOAs.add(el); + } + } } addFormOAs(dbOAs); + ConfigurationDBUtils.closeSession(); + return Constants.STRUTS_SUCCESS; } @@ -131,7 +148,7 @@ public class ListOAsAction extends ActionSupport implements ServletRequestAware, private void addFormOAs(List dbOAs) { formOAs = new ArrayList(); - if (dbOAs == null) { + if (dbOAs == null || dbOAs.size() == 0) { addActionError(LanguageHelper.getErrorString("errors.listOAs.noOA", request)); } else { diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java new file mode 100644 index 000000000..3f4b21fdd --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/struts/action/UserManagementAction.java @@ -0,0 +1,62 @@ +package at.gv.egovernment.moa.id.configuration.struts.action; + +import java.util.Date; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts2.interceptor.ServletRequestAware; +import org.apache.struts2.interceptor.ServletResponseAware; + +import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils; +import at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase; +import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; +import at.gv.egovernment.moa.id.configuration.Constants; +import at.gv.egovernment.moa.id.configuration.auth.AuthenticatedUser; + +import com.opensymphony.xwork2.ActionSupport; + +public class UserManagementAction extends ActionSupport + implements ServletRequestAware, ServletResponseAware { + + private static final long serialVersionUID = 1L; + + private HttpServletRequest request; + private HttpServletResponse response; + + private AuthenticatedUser authUser; + + + public String createTestUser() throws MOADatabaseException { + + UserDatabase user = new UserDatabase(); + user.setBpk(""); + user.setFamilyname("Max"); + user.setGivenname("Mustermann"); + user.setIsActive(true); + user.setIsAdmin(false); + user.setInstitut("EGIZ"); + user.setLastLoginItem(new Date()); + user.setMail("masdf@amfasdf.com"); + user.setPhone("00660011542"); + user.setUsername("testuser"); + + ConfigurationDBUtils.save(user); + + return Constants.STRUTS_SUCCESS; + } + + + public void setServletResponse(HttpServletResponse response) { + this.response = response; + + } + + public void setServletRequest(HttpServletRequest request) { + this.request = request; + + } + + + +} 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 a1bb23008..6da106b85 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 @@ -161,5 +161,27 @@ public class ValidationHelper { return "; % \" ' ` < > \\ /"; else return "; % \" ' ` , < > \\ /"; - } + } + + public static boolean isValidIdentityLinkSigner(String param) { + if (param == null) { + return false; + } + return param.indexOf(";") != -1 || + param.indexOf("%") != -1 || + param.indexOf("\"") != -1 || + param.indexOf("'") != -1 || + param.indexOf("?") != -1 || + param.indexOf("`") != -1 || + param.indexOf(",") != -1 || + param.indexOf("<") != -1 || + param.indexOf(">") != -1 || + param.indexOf("\\") != -1; + + } + + public static String getNotValidIdentityLinkSignerCharacters() { + + return "; % \" ' ` , < > \\"; + } } 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 new file mode 100644 index 000000000..cdd1d2c60 --- /dev/null +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/validation/moaconfig/MOAConfigValidator.java @@ -0,0 +1,94 @@ +package at.gv.egovernment.moa.id.configuration.validation.moaconfig; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import at.gv.egovernment.moa.id.configuration.data.GeneralMOAIDConfig; +import at.gv.egovernment.moa.id.configuration.helper.LanguageHelper; +import at.gv.egovernment.moa.id.configuration.validation.ValidationHelper; +import at.gv.egovernment.moa.util.MiscUtil; + +public class MOAConfigValidator { + + private static final Logger log = Logger.getLogger(MOAConfigValidator.class); + + public List validate(GeneralMOAIDConfig form) { + + List errors = new ArrayList(); + + log.debug("Validate general MOA configuration"); + + String check = form.getAlternativeSourceID(); + if (MiscUtil.isNotEmpty(check)) { + if (ValidationHelper.containsPotentialCSSCharacter(check, false)) { + log.warn("AlternativeSourceID contains potentail XSS characters: " + check); + errors.add(LanguageHelper.getErrorString("validation.general.AlternativeSourceID", + new Object[] {ValidationHelper.getPotentialCSSCharacter(false)} )); + } + } + + check = form.getCertStoreDirectory(); + if (MiscUtil.isNotEmpty(check)) { + if (ValidationHelper.isValidOAIdentifier(check)) { + log.warn("CertStoreDirectory contains potentail XSS characters: " + check); + errors.add(LanguageHelper.getErrorString("validation.general.certStoreDirectory.valid", + new Object[] {ValidationHelper.getNotValidOAIdentifierCharacters()} )); + } + } else { + log.info("CertStoreDirectory is empty."); + errors.add(LanguageHelper.getErrorString("validation.general.certStoreDirectory.empty")); + } + + check = form.getDefaultBKUHandy(); + if (MiscUtil.isNotEmpty(check)) { + if (!ValidationHelper.validateURL(check)) { + log.info("Not valid Handy-BKU URL"); + errors.add(LanguageHelper.getErrorString("validation.general.bku.handy.valid")); + } + } + + check = form.getDefaultBKULocal(); + if (MiscUtil.isNotEmpty(check)) { + if (!ValidationHelper.validateURL(check)) { + log.info("Not valid Online-BKU URL"); + errors.add(LanguageHelper.getErrorString("validation.general.bku.local.valid")); + } + } + + check = form.getDefaultBKUOnline(); + if (MiscUtil.isNotEmpty(check)) { + if (!ValidationHelper.validateURL(check)) { + log.info("Not valid Online-BKU URL"); + errors.add(LanguageHelper.getErrorString("validation.general.bku.online.valid")); + } + } + + check = form.getDefaultchainigmode(); + if (MiscUtil.isEmpty(check)) { + log.info("Empty Defaultchainigmode"); + errors.add(LanguageHelper.getErrorString("validation.general.Defaultchainigmode.empty")); + } else { + Map list = form.getChainigmodelist(); + if (!list.containsKey(check)) { + log.info("Not valid Defaultchainigmode " + check); + errors.add(LanguageHelper.getErrorString("validation.general.Defaultchainigmode.valid")); + } + } + + check = form.getIdentityLinkSigners(); + if (MiscUtil.isEmpty(check)) { + log.info("Empty IdentityLinkSigners"); + errors.add(LanguageHelper.getErrorString("validation.general.IdentityLinkSigners.empty")); + } else { + String[] list = check.split(GeneralMOAIDConfig.LINE_DELIMITER); + for(String el : list) { + + } + } + + return errors; + } +} diff --git a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties index 3aab1acc2..d0b6b6058 100644 --- a/id/ConfigWebTool/src/main/resources/applicationResources_de.properties +++ b/id/ConfigWebTool/src/main/resources/applicationResources_de.properties @@ -24,6 +24,57 @@ webpages.mainpage.menu.general.importexport=Importieren/Exportieren webpages.mainpage.menu.general.config.moaid=Allgemeine Konfiguration webpages.mainpage.menu.general.usermanagement=Benutzerverwaltung +webpages.moaconfig.header=Allgemeine Konfiguration +webpages.moaconfig.defaultbkus.header=Default BKUs +webpages.moaconfig.slrequesttemplates.header=SecurtiyLayer Request Templates +webpages.moaconfig.slrequesttemplates.local=Locale BKU +webpages.moaconfig.slrequesttemplates.handy=Handy BKU +webpages.moaconfig.slrequesttemplates.online=Online BKU +webpages.moaconfig.certificates.header=Zertifikatspr\u00fcfung +webpages.moaconfig.certificates.certstore=CertStoreDirecorty +webpages.moaconfig.certificates.trustmanagerrev=TrustManagerRevocationChecking +webpages.moaconfig.certificates.trustCACerts=TrustedCACertificates +webpages.moaconfig.certificates.chainingmode=ChainingMode +webpages.moaconfig.timeout.header=Session TimeOuts +webpages.moaconfig.timeout.assertion=Assertion [sec] +webpages.moaconfig.timeout.MOASessionCreated=SSO Session authentifiziert [sec] +webpages.moaconfig.timeout.MOASessionUpdated=SSO Session letzer Zugriff [sec] +webpages.moaconfig.moasp.header=MOA-SP Konfiguration +webpages.moaconfig.moasp.idltrustprofile=Personenbindung Trustprofil +webpages.moaconfig.moasp.authtrustprofile=Authentfizierungsblock Trustprofil +webpages.moaconfig.moasp.authblocktransform=Authentfizierungsblock Transformationen +webpages.moaconfig.moasp.url=URL zum MOA-SP Service +webpages.moaconfig.identitylinksigners=IdentityLinkSigners +webpages.moaconfig.services.header=Externe Services +webpages.moaconfig.services.mandates=Online-Vollmachten Service URL +webpages.moaconfig.services.szrgw=SZR Gateway Service URL +webpages.moaconfig.sso.header=Single Sign-On +webpages.moaconfig.sso.PublicUrl=SSO Service URL-Prefix +webpages.moaconfig.sso.FriendlyName=SSO Service Name +webpages.moaconfig.services.sso.Target=SSO Service Target +webpages.moaconfig.services.sso.SpecialText=SSO AuthBlockText +webpages.moaconfig.protocols.header=Protokolle +webpages.moaconfig.protocols.legacy.header=Legacy Modus aktivieren +webpages.moaconfig.protocols.legacy.saml1=SAML1 +webpages.moaconfig.protocols.legacy.pvp2=PVP2.1 +webpages.moaconfig.protocols.pvp2.header=PVP2 Konfiguration +webpages.moaconfig.protocols.pvp2.PublicUrlPrefix=PVP2 Service URL-Prefix +webpages.moaconfig.protocols.pvp2.IssuerName=PVP Service Name +webpages.moaconfig.protocols.pvp2.org.header=Organisation +webpages.moaconfig.protocols.pvp2.org.name=Kurzbezeichnung +webpages.moaconfig.protocols.pvp2.org.displayname=Vollständiger Name +webpages.moaconfig.protocols.pvp2.org.url=URL der Organisation +webpages.moaconfig.protocols.pvp2.contact.header=Kontaktdaten +webpages.moaconfig.protocols.pvp2.contact.surename=Familienname +webpages.moaconfig.protocols.pvp2.contact.givenname=Vorname +webpages.moaconfig.protocols.pvp2.contact.email=Mailadresse +webpages.moaconfig.protocols.pvp2.contact.company=Unternehmen +webpages.moaconfig.protocols.pvp2.contact.phone=Telefonnummer +webpages.moaconfig.protocols.pvp2.contact.type=Type des Kontakts +webpages.moaconfig.sl.transormations.header=SecurityLayer Transformationen +webpages.moaconfig.sl.transormations.filename=Dateiname +webpages.moaconfig.sl.transormations.upload=Neue Transformation hochladen + webpages.listOAs.list.first=Eindeutige Kennung webpages.listOAs.list.second=Name der Online-Applikation @@ -97,7 +148,14 @@ webpages.edit.delete=Online-Applikation l\u00f6schen webpages.header.info=Sie sind angemeldet als: webpages.header.lastlogin=Letzte Anmeldung am: -validation.general.aditionalauthblocktext=Der Zusatztext f\u00fcr enth\u00e4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt: {0} +validation.general.AlternativeSourceID=Die alternatice SourceID enth\u00e4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt: {0} +validation.general.certStoreDirectory.empty=CertStoreDirectory Feld ist leer. +validation.general.certStoreDirectory.valid=Das ertStoreDirectory Feld enth\u00e4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt: {0} +validation.general.Defaultchainigmode.empty=Es wurde kein DefaultChainingMode gewählt. +validation.general.Defaultchainigmode.valid=Der DefaultChainingMode enthält einen ungültigen Wert. + + +validation.general.aditionalauthblocktext=Der Zusatztext f\u00fcr den AuthBlock enth\u00e4lt nicht erlaubte Zeichen. Folgende Zeichen sind nicht erlaubt: {0} validation.general.bku.handy.empty=Die URL f\u00fcr die Handy-BKU ist leer. validation.general.bku.handy.valid=Die URL f\u00fcr die Handy-BKU hat kein g\u00fcltiges Format. validation.general.bku.local.empty=Die URL f\u00fcr die lokale BKU ist leer. diff --git a/id/ConfigWebTool/src/main/resources/struts.xml b/id/ConfigWebTool/src/main/resources/struts.xml index 652df73d8..83234ba3c 100644 --- a/id/ConfigWebTool/src/main/resources/struts.xml +++ b/id/ConfigWebTool/src/main/resources/struts.xml @@ -89,7 +89,7 @@ - /jsp/editGeneralConfig.jsp + /jsp/editMOAConfig.jsp /error.jsp /index.jsp main @@ -98,7 +98,7 @@ main - /jsp/editGeneralConfig.jsp + /jsp/editMOAConfig.jsp /error.jsp /index.jsp main @@ -112,6 +112,13 @@ + + main + /error.jsp + /index.jsp + + + \ No newline at end of file diff --git a/id/ConfigWebTool/src/main/webapp/css/index.css b/id/ConfigWebTool/src/main/webapp/css/index.css index c0b95abba..5edddd506 100644 --- a/id/ConfigWebTool/src/main/webapp/css/index.css +++ b/id/ConfigWebTool/src/main/webapp/css/index.css @@ -142,6 +142,19 @@ width: 100%; } +.moageneral_protocol_area { + clear: both; + margin-left: 25px; +} + +.moageneral_protocol_area>h4 { + margin-left: 10px; +} + +#moageneral_legacy_protocol>.wwgrp { + clear: none; +} + .wwlbl { float: left; padding-right: 10px; diff --git a/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp new file mode 100644 index 000000000..b902e438d --- /dev/null +++ b/id/ConfigWebTool/src/main/webapp/jsp/editMOAConfig.jsp @@ -0,0 +1,354 @@ +<%@ page contentType="text/html;charset=UTF-8" %> +<%@page import="at.gv.egovernment.moa.id.configuration.helper.LanguageHelper"%> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + + + + + <%=LanguageHelper.getGUIString("title", request) %> + + + + + + + + + + + +
+ +
+ + +
+
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.header", request) %>

+ + + + + +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.defaultbkus.header", request) %>

+ + + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.slrequesttemplates.header", request) %>

+ + + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.certificates.header", request) %>

+ + + + + + + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.timeout.header", request) %>

+ + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.moasp.header", request) %>

+ + + + + + + + + + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.services.header", request) %>

+ + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.sso.header", request) %>

+ + + + + + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.protocols.header", request) %>

+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.protocols.legacy.header", request) %>

+ + + + +
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.protocols.pvp2.header", request) %>

+ + + + + + +
<%=LanguageHelper.getGUIString("webpages.moaconfig.protocols.pvp2.org.header", request) %>
+ + + + + + + +
<%=LanguageHelper.getGUIString("webpages.moaconfig.protocols.pvp2.contact.header", request) %>
+ + + + + + + + + + + + +
+
+ +
+

<%=LanguageHelper.getGUIString("webpages.moaconfig.sl.transormations.header", request) %>

+ + + + +
+ +
+
+
+ +
+
+ +
+ + +
+ +
+ +
+
+ +
+ + + + + \ No newline at end of file diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java index d4736efbb..ff8c562a7 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/auth/AuthConfigurationProvider.java @@ -304,6 +304,12 @@ public class AuthConfigurationProvider extends ConfigurationProvider { moaidconfig = ConfigurationDBRead.getMOAIDConfiguration(); if (moaidconfig != null) ConfigurationDBUtils.delete(moaidconfig); + + List oas = ConfigurationDBRead.getAllOnlineApplications(); + if (oas != null && oas.size() > 0) { + for (OnlineApplication oa : oas) + ConfigurationDBUtils.delete(oa); + } } //load legacy config if it is configured diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java index 61f0f7e90..7ec8c823e 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java @@ -127,6 +127,7 @@ public class BuildFromLegacyConfig { //Load generic Config Map genericConfiguration = builder.buildGenericConfiguration(); GeneralConfiguration authGeneral = new GeneralConfiguration(); + if (genericConfiguration.containsKey(GENERIC_CONFIG_PARAM_SOURCEID)) authGeneral.setAlternativeSourceID( (String)genericConfiguration.get(GENERIC_CONFIG_PARAM_SOURCEID)); @@ -210,12 +211,14 @@ public class BuildFromLegacyConfig { String[] transformsInfos = builder.loadTransformsInfos(transformsInfoFileNames); List auth_transformInfos = new ArrayList(); - for (String transformInfo : transformsInfos) { + + for (int i=0; i searchOnlineApplicationsFromUser(long userid, String oaid) { - MiscUtil.assertNotNull(oaid, "OnlineApplictionID"); - MiscUtil.assertNotNull(userid, "UserID"); - - Logger.trace("Getting OnlineApplication with ID " + oaid - + " from user with UserID " + userid + " database."); - - List result; - EntityManager session = ConfigurationDBUtils.getCurrentSession(); - - javax.persistence.Query query = session.createQuery(QUERIES.get("searchOnlineApplicationsFormUserWithID")); - query.setParameter("userid", userid); - query.setParameter("oaid", "%"+oaid+"%"); - - result = query.getResultList(); - - Logger.trace("Found entries: " + result.size()); - - if (result.size() == 0) { - Logger.trace("No entries found."); - return null; - } - - return result; - } - + public static UserDatabase getUserWithID(long id) { MiscUtil.assertNotNull(id, "UserID"); Logger.trace("Getting Userinformation with ID " + id + " from database."); diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java deleted file mode 100644 index d1887bfa6..000000000 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java +++ /dev/null @@ -1,263 +0,0 @@ -package at.gv.egovernment.moa.id.commons.db.dao.config; - -import java.io.Serializable; -import java.util.Date; -import java.util.List; - -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.PreUpdate; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; - -import org.hibernate.annotations.DynamicUpdate; - -import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication; - - -@Entity -@DynamicUpdate(value=true) -@Table(name = "userdatabase") -public class UserDatabase implements Serializable{ - - private static final long serialVersionUID = 1L; - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - @Column(name = "id", unique=true, nullable=false) - private long id; - - @Column(name = "givenname", nullable=false) - private String givenname; - - @Column(name = "familyname", nullable=false) - private String familyname; - - @Column(name = "institut", nullable=false) - private String institut; - - @Column(name = "mail", nullable=false) - private String mail; - - @Column(name = "phone", nullable=false) - private String phone; - - @Column(name = "username", unique=true, nullable=false) - private String username; - - @Column(name = "password", nullable=false) - private String password; - - @Column(name = "bpk", unique=true, nullable=false) - private String bpk; - - @Column(name = "isadmin", nullable=false) - private boolean isadmin; - - @Column(name = "isactive", nullable=false) - private boolean isactive; - - @OneToMany(mappedBy="hjid", cascade=CascadeType.REFRESH) - private List registratedOAs = null; - - @Column(name = "lastlogin") - @Temporal(TemporalType.TIMESTAMP) - private Date lastlogin; - - @PreUpdate - protected void lastUpdate() { - this.lastlogin = new Date(); - } - - /** - * @return the id - */ - public long getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(long id) { - this.id = id; - } - - /** - * @return the givenname - */ - public String getGivenname() { - return givenname; - } - - /** - * @param givenname the givenname to set - */ - public void setGivenname(String givenname) { - this.givenname = givenname; - } - - /** - * @return the familyname - */ - public String getFamilyname() { - return familyname; - } - - /** - * @param familyname the familyname to set - */ - public void setFamilyname(String familyname) { - this.familyname = familyname; - } - - /** - * @return the institut - */ - public String getInstitut() { - return institut; - } - - /** - * @param institut the institut to set - */ - public void setInstitut(String institut) { - this.institut = institut; - } - - /** - * @return the mail - */ - public String getMail() { - return mail; - } - - /** - * @param mail the mail to set - */ - public void setMail(String mail) { - this.mail = mail; - } - - /** - * @return the phone - */ - public String getPhone() { - return phone; - } - - /** - * @param phone the phone to set - */ - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * @param username the username to set - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * @param password the password to set - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * @return the bpk - */ - public String getBpk() { - return bpk; - } - - /** - * @param bpk the bpk to set - */ - public void setBpk(String bpk) { - this.bpk = bpk; - } - - /** - * @return the isadmin - */ - public boolean isIsadmin() { - return isadmin; - } - - /** - * @param isadmin the isadmin to set - */ - public void setIsadmin(boolean isadmin) { - this.isadmin = isadmin; - } - - /** - * @return the isactive - */ - public boolean isIsactive() { - return isactive; - } - - /** - * @param isactive the isactive to set - */ - public void setIsactive(boolean isactive) { - this.isactive = isactive; - } - - /** - * @return the registratedOAs - */ - public List getRegistratedOAs() { - return registratedOAs; - } - - /** - * @param registratedOAs the registratedOAs to set - */ - public void setRegistratedOAs(List registratedOAs) { - this.registratedOAs = registratedOAs; - } - - /** - * @return the lastlogin - */ - public Date getLastlogin() { - return lastlogin; - } - - /** - * @param lastlogin the lastlogin to set - */ - public void setLastlogin(Date lastlogin) { - this.lastlogin = lastlogin; - } - - -} - - diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java index c7672f9ba..6e0f47805 100644 --- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java +++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/OASessionStore.java @@ -45,7 +45,6 @@ public class OASessionStore implements Serializable{ // this.created = new Date(); // } - //@ManyToOne(fetch=FetchType.LAZY) @ManyToOne(fetch=FetchType.LAZY) @JoinColumn(name = "moasession") private AuthenticatedSessionStore moasession; 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 a90205260..ac8aa3b40 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 @@ -1,6 +1,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -171,31 +191,11 @@ - + enthält Parameter für die OA - - - - - - - - - - - - - - - - - - - - @@ -429,15 +429,6 @@ - - - - - - - - - @@ -504,7 +495,7 @@ - + enthält Parameter über die OA, die die @@ -941,4 +932,20 @@ + + + + + + + + + + + + + + + + diff --git a/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml b/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml index bd60f5a46..25092ff58 100644 --- a/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml +++ b/id/server/moa-id-commons/src/main/resources/config/persistence_template.xml @@ -2,7 +2,7 @@ - at.gv.egovernment.moa.id.commons.db.dao.config.UserDatabase +