aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2013-07-19 11:50:19 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2013-07-19 11:50:19 +0200
commit71da4a9bc7e2ff79b2fb4cf8903d15fd75372859 (patch)
treea2a5841c65ebb4bda12d703378fc41b3cec69fb4 /id/server/moa-id-commons
parent49acb697426d3c313ad047449ea62ac1bf3f4fd0 (diff)
downloadmoa-id-spss-71da4a9bc7e2ff79b2fb4cf8903d15fd75372859.tar.gz
moa-id-spss-71da4a9bc7e2ff79b2fb4cf8903d15fd75372859.tar.bz2
moa-id-spss-71da4a9bc7e2ff79b2fb4cf8903d15fd75372859.zip
SSO and Configuration updated
TODO: --PVP2 from configuration --UseIFrame for OAs --SSO with mandates --Resign IdentityLink --Encrypted MOASession in Database
Diffstat (limited to 'id/server/moa-id-commons')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java2
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java14
-rw-r--r--id/server/moa-id-commons/src/main/resources/config/moaid_config_2.0.xsd36
3 files changed, 28 insertions, 24 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
index 8970a82aa..7a6efc5ac 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBRead.java
@@ -27,7 +27,7 @@ public class ConfigurationDBRead {
List result;
EntityManager session = ConfigurationDBUtils.getCurrentSession();
-
+
javax.persistence.Query query = session.createQuery(QUERIES.get("getOnlineApplicationWithID"));
//query.setParameter("id", id+"%");
query.setParameter("id", id);
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
index bc6a0b922..dc0e493d1 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/ConfigurationDBUtils.java
@@ -8,7 +8,7 @@ import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.hibernate.HibernateException;
-import org.hibernate.Session;
+
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.logging.Logger;
@@ -18,7 +18,7 @@ public final class ConfigurationDBUtils {
private static EntityManagerFactory entitymanagerfactory;
@SuppressWarnings("rawtypes")
- private static final ThreadLocal THREAD_LOCAL = new ThreadLocal();
+ private static final ThreadLocal THREAD_LOCAL_CONFIG = new ThreadLocal();
private static boolean automaticSessionHandling = false;
protected ConfigurationDBUtils() { }
@@ -69,7 +69,7 @@ public final class ConfigurationDBUtils {
return entitymanagerfactory.createEntityManager();
}
- EntityManager session = (EntityManager) THREAD_LOCAL.get();
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
// Open a new Session, if this Thread has none yet
if (session == null) {
session = getNewSession();
@@ -84,7 +84,7 @@ public final class ConfigurationDBUtils {
//return sessionFactory.getCurrentSession();
return entitymanagerfactory.createEntityManager();
}
- EntityManager session = (EntityManager) THREAD_LOCAL.get();
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
if (session != null) {
Logger.warn("Previous session has not been closed; closing session now.");
closeSession();
@@ -92,7 +92,7 @@ public final class ConfigurationDBUtils {
Logger.debug("Opening new hibernate session...");
try {
session = entitymanagerfactory.createEntityManager();
- THREAD_LOCAL.set(session);
+ THREAD_LOCAL_CONFIG.set(session);
} catch (HibernateException hex) {
Logger.error(hex.getMessage());
}
@@ -113,8 +113,8 @@ public final class ConfigurationDBUtils {
return;
}
Logger.debug("Closing current hibernate session...");
- Session session = (Session) THREAD_LOCAL.get();
- THREAD_LOCAL.set(null);
+ EntityManager session = (EntityManager) THREAD_LOCAL_CONFIG.get();
+ THREAD_LOCAL_CONFIG.set(null);
if (session != null) {
try {
session.close();
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 e7ca2d0dd..b7982aca5 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
@@ -329,10 +329,13 @@
</xsd:element>
<xsd:element name="SSO">
<xsd:complexType>
- <xsd:sequence>
+ <xsd:choice>
<xsd:element name="target" type="xsd:string"/>
- <xsd:element name="FriendlyName" type="xsd:string"/>
- </xsd:sequence>
+ <xsd:element ref="IdentificationNumber" minOccurs="1"/>
+ </xsd:choice>
+ <xsd:attribute name="PublicURL" type="xsd:string"/>
+ <xsd:attribute name="FriendlyName" type="xsd:string"/>
+ <xsd:attribute name="SpecialText" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="SecurityLayer">
@@ -538,14 +541,7 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="IdentificationNumber" minOccurs="0">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="Type" type="xsd:string"/>
- <xsd:element name="Value" type="xsd:string"/>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
+ <xsd:element ref="IdentificationNumber" minOccurs="0"/>
<xsd:element name="Templates" type="TemplatesType" minOccurs="0"/>
<xsd:element name="TransformsInfo" type="TransformsInfoType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Mandates" minOccurs="0">
@@ -896,11 +892,11 @@
<xsd:element name="OA_SAML1">
<xsd:complexType>
<xsd:sequence>
- <xsd:element name="provideStammzahl" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
- <xsd:element name="provideAUTHBlock" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
- <xsd:element name="provideIdentityLink" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
- <xsd:element name="provideCertificate" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
- <xsd:element name="provideFullMandatorData" type="xsd:boolean" minOccurs="1" maxOccurs="1" default="false"/>
+ <xsd:element name="provideStammzahl" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="provideAUTHBlock" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="provideIdentityLink" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="provideCertificate" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="provideFullMandatorData" type="xsd:boolean" default="false" minOccurs="1" maxOccurs="1"/>
<xsd:element name="useCondition" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
<xsd:element name="conditionLength" type="xsd:integer" minOccurs="0" maxOccurs="1"/>
<xsd:element name="sourceID" type="xsd:string" minOccurs="0" maxOccurs="1"/>
@@ -933,4 +929,12 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
+ <xsd:element name="IdentificationNumber">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="Type" type="xsd:string"/>
+ <xsd:element name="Value" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
</xsd:schema>