aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/legacy/BuildFromLegacyConfig.java78
1 files changed, 35 insertions, 43 deletions
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 96d0bd2ed..8e24bdfdd 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
@@ -1,7 +1,27 @@
+/*******************************************************************************
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, and Graz University of Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ *******************************************************************************/
package at.gv.egovernment.moa.id.config.legacy;
-import iaik.x509.X509Certificate;
-
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -16,22 +36,18 @@ import java.util.Map;
import java.util.Properties;
import java.util.Set;
-import org.bouncycastle.crypto.macs.OldHMac;
import org.opensaml.saml2.metadata.RequestedAttribute;
-import org.opensaml.xml.XMLObject;
import org.w3c.dom.Element;
import eu.stork.vidp.messages.util.SAMLUtil;
import eu.stork.vidp.messages.util.XMLUtil;
-import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.dao.config.AuthComponentGeneral;
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.CPEPS;
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.ClientKeyStore;
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;
@@ -54,7 +70,6 @@ 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.RequestedAttributeType;
import at.gv.egovernment.moa.id.commons.db.dao.config.SAMLSigningParameter;
import at.gv.egovernment.moa.id.commons.db.dao.config.SLRequestTemplates;
import at.gv.egovernment.moa.id.commons.db.dao.config.SSO;
@@ -74,7 +89,6 @@ import at.gv.egovernment.moa.id.config.ConfigurationProvider;
import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.data.IssuerAndSerial;
-import at.gv.egovernment.moa.id.protocols.pvp2x.utils.SAML2Utils;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.DOMUtils;
@@ -136,7 +150,7 @@ public class BuildFromLegacyConfig {
//Load generic Config
- Map genericConfiguration = builder.buildGenericConfiguration();
+ Map<String, String> genericConfiguration = builder.buildGenericConfiguration();
GeneralConfiguration authGeneral = new GeneralConfiguration();
if (genericConfiguration.containsKey(GENERIC_CONFIG_PARAM_SOURCEID))
@@ -168,21 +182,18 @@ public class BuildFromLegacyConfig {
authGeneral.setTimeOuts(timeOuts);
generalAuth.setGeneralConfiguration(authGeneral);
-
- //TODO: set Protocols!!!!
Protocols auth_protocols = new Protocols();
generalAuth.setProtocols(auth_protocols);
LegacyAllowed prot_legacy = new LegacyAllowed();
auth_protocols.setLegacyAllowed(prot_legacy);
- final List<String> PROTOCOLS_LEGACY_ALLOWED = Arrays.asList("id_saml1","id_pvp2x"); //TODO: set default values
+ final List<String> PROTOCOLS_LEGACY_ALLOWED = Arrays.asList("id_saml1","id_pvp2x");
prot_legacy.setProtocolName(PROTOCOLS_LEGACY_ALLOWED);
- //TODO: remove beta test values
PVP2 prot_pvp2 = new PVP2();
auth_protocols.setPVP2(prot_pvp2);
- prot_pvp2.setPublicURLPrefix("https://labda.iaik.tugraz.at:8443/moa-id-auth/");
- prot_pvp2.setIssuerName("MOA-ID 2.0 Demo IDP");
+ prot_pvp2.setPublicURLPrefix("https://....");
+ prot_pvp2.setIssuerName("MOA-ID 2.x IDP");
Organization pvp2_org = new Organization();
prot_pvp2.setOrganization(pvp2_org);
@@ -213,8 +224,8 @@ public class BuildFromLegacyConfig {
//SSO
SSO auth_sso = new SSO();
generalAuth.setSSO(auth_sso);
- auth_sso.setTarget("BF");
- auth_sso.setFriendlyName("EGIZ MOAID 2.0 Beta");
+ auth_sso.setTarget("");
+ auth_sso.setFriendlyName("");
//set SecurityLayer Transformations
@@ -268,7 +279,6 @@ public class BuildFromLegacyConfig {
auth_moaSP.setVerifyAuthBlock(auth_moaSP_verifyAuthBlock);
- //TODO: check correctness!!!
//set IdentityLinkSigners
IdentityLinkSigners auth_idsigners = new IdentityLinkSigners();
generalAuth.setIdentityLinkSigners(auth_idsigners);
@@ -399,7 +409,7 @@ public class BuildFromLegacyConfig {
//set general OA configuration
moa_oa.setCalculateHPI(false); //TODO: Bernd fragen warum das nicht direkt über den Bereichsidentifyer definert wird
moa_oa.setFriendlyName(oa.getFriendlyName());
- moa_oa.setKeyBoxIdentifier(MOAKeyBoxSelector.fromValue(oa.getKeyBoxIdentifier())); //TODO: check correctness
+ moa_oa.setKeyBoxIdentifier(MOAKeyBoxSelector.fromValue(oa.getKeyBoxIdentifier()));
moa_oa.setPublicURLPrefix(oa.getPublicURLPrefix());
moa_oa.setTarget(oa.getTarget());
moa_oa.setTargetFriendlyName(oa.getTargetFriendlyName());
@@ -411,9 +421,9 @@ public class BuildFromLegacyConfig {
moa_oa.setAuthComponentOA(oa_auth);
//SLLayer Version / useIframe
- oa_auth.setSlVersion(oa.getSlVersion());
- oa_auth.setUseIFrame(false);
- oa_auth.setUseUTC(oa.getUseUTC());
+// oa_auth.setSlVersion(oa.getSlVersion());
+// oa_auth.setUseIFrame(false);
+// oa_auth.setUseUTC(oa.getUseUTC());
//BKUURLs
@@ -477,26 +487,12 @@ public class BuildFromLegacyConfig {
oa_saml1.setProvideIdentityLink(oa.getProvideIdentityLink());
oa_saml1.setProvideStammzahl(oa.getProvideStammzahl());
oa_saml1.setUseCondition(oa.getUseCondition());
+ oa_saml1.setIsActive(true);
//OA_PVP2
OAPVP2 oa_pvp2 = new OAPVP2();
oa_auth.setOAPVP2(oa_pvp2);
-
-// oa_pvp2.setMetadataURL("empty");
-//
-// //TODO: is only a workaround!!!!
-// Properties props = getGeneralPVP2ProperiesConfig(properies);
-// File dir = new File(props.getProperty("idp.truststore"));
-// File[] files = dir.listFiles();
-// if (files.length > 0) {
-// FileInputStream filestream = new FileInputStream(files[0]);
-// X509Certificate signerCertificate = new X509Certificate(filestream);
-// oa_pvp2.setCertificate(signerCertificate.getEncoded());
-//
-// } else {
-// oa_pvp2.setCertificate(null);
-// }
-
+
moa_oas.add(moa_oa);
//ConfigurationDBUtils.save(moa_oa);
}
@@ -531,11 +527,7 @@ public class BuildFromLegacyConfig {
//set trustedCACertificate path
moaIDConfig.setTrustedCACertificates(builder.getTrustedCACertificates());
-
- //TODO: move to read config functionality
- //trustedCACertificates = FileUtils.makeAbsoluteURL(trustedCACertificates, rootConfigFileDir);
-
-
+
//Not required in MOAID 2.0 config (DefaultBKUs & SLRequestTemplates)
//trustedBKUs = builder.getTrustedBKUs();
//trustedTemplateURLs = builder.getTrustedTemplateURLs();