aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-06 14:27:51 +0100
committerBojan Suzic <bojan.suzic@iaik.tugraz.at>2014-02-06 14:27:51 +0100
commit6d87d9ac833d061e38f67d2cdbe33f1f2d24646d (patch)
tree40f78a2934f7fe9be962ab9a4b4db8dde9ec6ff8 /id
parenta01dd39072666b5b9b2ffeb97cef9a54e3dec97f (diff)
parentf9b31bdc4781d6eca20bc2d993f08f6a4eb462f2 (diff)
downloadmoa-id-spss-6d87d9ac833d061e38f67d2cdbe33f1f2d24646d.tar.gz
moa-id-spss-6d87d9ac833d061e38f67d2cdbe33f1f2d24646d.tar.bz2
moa-id-spss-6d87d9ac833d061e38f67d2cdbe33f1f2d24646d.zip
t Merge branch 'moa1_0_tlenz' of gitlab.iaik.tugraz.at:afitzek/moa-idspss into moa2_0_tlenz_bs_2
Diffstat (limited to 'id')
-rw-r--r--id/ConfigWebTool/pom.xml31
-rw-r--r--id/server/idserverlib/pom.xml16
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java10
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java7
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java29
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java6
9 files changed, 74 insertions, 33 deletions
diff --git a/id/ConfigWebTool/pom.xml b/id/ConfigWebTool/pom.xml
index ae8b62645..15228a30e 100644
--- a/id/ConfigWebTool/pom.xml
+++ b/id/ConfigWebTool/pom.xml
@@ -51,13 +51,40 @@
<groupId>MOA.id.server</groupId>
<artifactId>moa-id-lib</artifactId>
<!-- <version>1.9.98-SNAPSHOT</version> -->
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
- <dependency>
+ <dependency>
<groupId>at.gv.util</groupId>
<artifactId>egovutils</artifactId>
<version>1.0.4</version>
- </dependency>
+ <exclusions>
+ <exclusion>
+ <groupId>com.sun</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+
+ </dependency>
+
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>opensaml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.struts</groupId>
diff --git a/id/server/idserverlib/pom.xml b/id/server/idserverlib/pom.xml
index c4d5310bf..cca543a26 100644
--- a/id/server/idserverlib/pom.xml
+++ b/id/server/idserverlib/pom.xml
@@ -208,17 +208,15 @@
</exclusions>
</dependency> -->
- <dependency>
+ <dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml</artifactId>
- <version>2.6.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.opensaml</groupId>
- <artifactId>xmltooling</artifactId>
- <version>1.4.0</version>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>org.opensaml</groupId>
+ <artifactId>xmltooling</artifactId>
+ </dependency>
+
<dependency>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
index 67433dde7..bcd7cdc78 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/parser/StartAuthentificationParameterParser.java
@@ -22,6 +22,8 @@
******************************************************************************/
package at.gv.egovernment.moa.id.auth.parser;
+import iaik.util.logging.Log;
+
import java.io.UnsupportedEncodingException;
import java.util.List;
@@ -238,6 +240,12 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
moasession.setBkuURL(bkuURL);
+ if (MiscUtil.isEmpty(templateURL)) {
+ templateURL = oaParam.getTemplateURL().get(0).getURL();
+ Log.info("No SL-Template in request, load SL-Template from OA config (URL: " + templateURL + ")");
+
+ }
+
if (!ParamValidatorUtils.isValidTemplate(req, templateURL, oaParam.getTemplateURL()))
throw new WrongParametersException("StartAuthentication", PARAM_TEMPLATE, "auth.12");
moasession.setTemplateURL(templateURL);
@@ -275,7 +283,7 @@ public class StartAuthentificationParameterParser implements MOAIDAuthConstants{
oaURL = request.getOAURL();
target = request.getTarget();
-
+
parse(moasession, target, oaURL, bkuURL, templateURL, useMandate, ccc, modul, action, req);
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java
index 84265f4ba..3432a19b1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/ConfigurationProvider.java
@@ -76,6 +76,13 @@ public class ConfigurationProvider {
public static final String CONFIG_PROPERTY_NAME =
"moa.id.configuration";
+ /**
+ * The name of the system property which contains the file name of the
+ * configuration file.
+ */
+ public static final String PROXY_CONFIG_PROPERTY_NAME =
+ "moa.id.proxy.configuration";
+
/**
* The name of the generic configuration property giving the certstore directory path.
*/
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java
index ecde454dd..93de902ef 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/config/proxy/ProxyConfigurationProvider.java
@@ -116,7 +116,7 @@ public class ProxyConfigurationProvider extends ConfigurationProvider {
*/
public static synchronized ProxyConfigurationProvider reload()
throws ConfigurationException {
- String fileName = System.getProperty(CONFIG_PROPERTY_NAME);
+ String fileName = System.getProperty(PROXY_CONFIG_PROPERTY_NAME);
if (fileName == null) {
throw new ConfigurationException("config.01", null);
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java
index 769e36fc1..5d71b915f 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/config/PVPConfiguration.java
@@ -25,9 +25,7 @@ package at.gv.egovernment.moa.id.protocols.pvp2x.config;
import iaik.x509.X509Certificate;
import java.io.File;
-import java.io.IOException;
import java.net.URL;
-import java.net.URLClassLoader;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List;
@@ -50,7 +48,6 @@ import org.opensaml.saml2.metadata.TelephoneNumber;
import at.gv.egovernment.moa.id.commons.db.dao.config.Contact;
import at.gv.egovernment.moa.id.commons.db.dao.config.OAPVP2;
-import at.gv.egovernment.moa.id.commons.db.dao.config.PVP2;
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;
@@ -111,12 +108,12 @@ public class PVPConfiguration {
private static String moaIDVersion = null;
- PVP2 generalpvpconfigdb;
+ //PVP2 generalpvpconfigdb;
Properties props;
private PVPConfiguration() {
try {
- generalpvpconfigdb = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig();
+ //generalpvpconfigdb = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig();
props = AuthConfigurationProvider.getInstance().getGeneralPVP2ProperiesConfig();
} catch (ConfigurationException e) {
@@ -124,8 +121,8 @@ public class PVPConfiguration {
}
}
- public String getIDPPublicPath() {
- String publicPath = generalpvpconfigdb.getPublicURLPrefix();
+ public String getIDPPublicPath() throws ConfigurationException {
+ String publicPath = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getPublicURLPrefix();
if(publicPath != null) {
if(publicPath.endsWith("/")) {
int length = publicPath.length();
@@ -135,15 +132,15 @@ public class PVPConfiguration {
return publicPath;
}
- public String getIDPSSOPostService() {
+ public String getIDPSSOPostService() throws ConfigurationException {
return getIDPPublicPath() + PVP2_POST;
}
- public String getIDPSSORedirectService() {
+ public String getIDPSSORedirectService() throws ConfigurationException {
return getIDPPublicPath() + PVP2_REDIRECT;
}
- public String getIDPSSOMetadataService() {
+ public String getIDPSSOMetadataService() throws ConfigurationException {
return getIDPPublicPath() + PVP2_METADATA;
}
@@ -171,13 +168,13 @@ public class PVPConfiguration {
return props.getProperty(IDP_KEY_PASSASSERTION);
}
- public String getIDPIssuerName() {
+ public String getIDPIssuerName() throws ConfigurationException {
if (moaIDVersion == null) {
moaIDVersion = parseMOAIDVersionFromManifest();
}
- return generalpvpconfigdb.getIssuerName() + moaIDVersion;
+ return AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getIssuerName() + moaIDVersion;
}
public List<String> getMetadataFiles() {
@@ -250,10 +247,10 @@ public class PVPConfiguration {
}
}
- public List<ContactPerson> getIDPContacts() {
+ public List<ContactPerson> getIDPContacts() throws ConfigurationException {
List<ContactPerson> list = new ArrayList<ContactPerson>();
- List<Contact> contacts = generalpvpconfigdb.getContact();
+ List<Contact> contacts = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getContact();
if (contacts != null) {
@@ -344,10 +341,10 @@ public class PVPConfiguration {
return list;
}
- public Organization getIDPOrganisation() {
+ public Organization getIDPOrganisation() throws ConfigurationException {
Organization org = SAML2Utils.createSAMLObject(Organization.class);
- at.gv.egovernment.moa.id.commons.db.dao.config.Organization organisation = generalpvpconfigdb.getOrganization();
+ at.gv.egovernment.moa.id.commons.db.dao.config.Organization organisation = AuthConfigurationProvider.getInstance().getGeneralPVP2DBConfig().getOrganization();
String org_name = null;
String org_dispname = null;
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
index f4b48ece3..21c0d85a1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/pvp2x/requestHandler/AuthnRequestHandler.java
@@ -96,7 +96,9 @@ public class AuthnRequestHandler implements IRequestHandler, PVPConstants {
Response authResponse = SAML2Utils.createSAMLObject(Response.class);
Issuer nissuer = SAML2Utils.createSAMLObject(Issuer.class);
- nissuer.setValue(PVPConfiguration.getInstance().getIDPIssuerName());
+
+ //change to entity value from entity name to IDP EntityID (URL)
+ nissuer.setValue(PVPConfiguration.getInstance().getIDPPublicPath());
nissuer.setFormat(NameID.ENTITY);
authResponse.setIssuer(nissuer);
authResponse.setInResponseTo(authnRequest.getID());
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java
index 86da34e1c..9f3de08aa 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/proxy/XMLLoginParameterResolverEncryptedData.java
@@ -267,7 +267,7 @@ public class XMLLoginParameterResolverEncryptedData implements LoginParameterRes
//make file name absolut (if it is relative to main config file)
//TODO MOAID XMLLPR check
- String moaIDConfigFileName = System.getProperty(ConfigurationProvider.CONFIG_PROPERTY_NAME);
+ String moaIDConfigFileName = System.getProperty(ConfigurationProvider.PROXY_CONFIG_PROPERTY_NAME);
String rootConfigFileDir = new File(moaIDConfigFileName).getParent();
this.identityFile = FileUtils.makeAbsoluteURL(configuration, rootConfigFileDir);
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
index 3b6e001bf..327170054 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/util/ParamValidatorUtils.java
@@ -266,7 +266,7 @@ public class ParamValidatorUtils implements MOAIDAuthConstants{
// if non parameter is given return true
if (StringUtils.isEmpty(template)) {
Logger.debug("Parameter Template bzw. bkuSelectionTemplateURL ist null");
- return true;
+ return false;
}
// check if template is a valid URL
@@ -524,7 +524,9 @@ public class ParamValidatorUtils implements MOAIDAuthConstants{
return false;
}
- if (StringUtils.isEmpty(oaURL) || StringUtils.isEmpty(templateURL) || StringUtils.isEmpty(bkuURL))
+ if (StringUtils.isEmpty(oaURL)
+ //|| StringUtils.isEmpty(templateURL)
+ || StringUtils.isEmpty(bkuURL) )
return false;
else
return true;