aboutsummaryrefslogtreecommitdiff
path: root/id/server
diff options
context:
space:
mode:
Diffstat (limited to 'id/server')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java33
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java2
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java9
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java2
5 files changed, 25 insertions, 23 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java
index 778c5ef34..536f3ee04 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/IDPSingleLogOutServlet.java
@@ -99,6 +99,7 @@ public class IDPSingleLogOutServlet extends AuthServlet {
.getSession(moaSessionID);
if(authSession != null) {
authmanager.performSingleLogOut(req, resp, authSession, null);
+ return;
}
@@ -109,23 +110,21 @@ public class IDPSingleLogOutServlet extends AuthServlet {
// TODO Auto-generated catch block
e.printStackTrace();
}
- }
- }
-
- } else {
- VelocityContext context = new VelocityContext();
- context.put("successMsg",
- MOAIDMessageProvider.getInstance().getMessage("slo.02", null));
- try {
- ssomanager.printSingleLogOutInfo(context, resp);
-
-
- } catch (MOAIDException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- }
+ }
+ }
+ }
+
+ VelocityContext context = new VelocityContext();
+ context.put("successMsg",
+ MOAIDMessageProvider.getInstance().getMessage("slo.02", null));
+ try {
+ ssomanager.printSingleLogOutInfo(context, resp);
+
+ } catch (MOAIDException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
index d8c3eebb5..9dddce4b0 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/AuthenticationManager.java
@@ -512,7 +512,7 @@ public class AuthenticationManager extends AuthServlet {
try {
//check if an MOASession exists and if not create an new MOASession
//moasession = getORCreateMOASession(request);
- moasession = AuthenticationSessionStoreage.createSession();
+ moasession = AuthenticationSessionStoreage.createSession(target.getRequestID());
} catch (MOADatabaseException e1) {
Logger.error("Database Error! MOASession can not be created!");
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
index 890ec9f0d..2dbcc912b 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AssertionStorage.java
@@ -183,7 +183,7 @@ public class AssertionStorage {
private void cleanDelete(AssertionStore element) {
try {
- element.setAssertion(new byte[]{});
+ element.setAssertion("blank".getBytes());
MOASessionDBUtils.saveOrUpdate(element);
} catch (MOADatabaseException e) {
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java
index 1c74aea55..27f53feed 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java
@@ -72,7 +72,7 @@ public class AuthenticationSessionStoreage {
}
}
- public static AuthenticationSession createSession() throws MOADatabaseException, BuildException {
+ public static AuthenticationSession createSession(String pendingRequestID) throws MOADatabaseException, BuildException {
String id = Random.nextRandom();
AuthenticatedSessionStore dbsession = new AuthenticatedSessionStore();
@@ -84,6 +84,8 @@ public class AuthenticationSessionStoreage {
dbsession.setCreated(now);
dbsession.setUpdated(now);
+ dbsession.setPendingRequestID(pendingRequestID);
+
AuthenticationSession session = new AuthenticationSession(id, now);
encryptSession(session, dbsession);
@@ -366,7 +368,7 @@ public class AuthenticationSessionStoreage {
dbsession.setSSOSession(true);
dbsession.setSSOsessionid(SSOSessionID);
dbsession.setAuthenticated(false);
- dbsession.setPendingRequestID("");
+ dbsession.setPendingRequestID("empty");
//Store MOASession
session.saveOrUpdate(dbsession);
@@ -700,6 +702,7 @@ public class AuthenticationSessionStoreage {
dbsession = new AuthenticatedSessionStore();
dbsession.setSessionid(id);
dbsession.setCreated(now);
+ dbsession.setPendingRequestID(req.getRequestID());
session = new AuthenticationSession(id, now);
} else {
@@ -903,7 +906,7 @@ public class AuthenticationSessionStoreage {
private static void cleanDelete(AuthenticatedSessionStore result) {
try {
- result.setSession(new byte[] {});
+ result.setSession("blank".getBytes());
MOASessionDBUtils.saveOrUpdate(result);
} catch (MOADatabaseException e) {
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java
index 182995786..e27bd6cd7 100644
--- a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/session/AuthenticatedSessionStore.java
@@ -93,7 +93,7 @@ public class AuthenticatedSessionStore implements Serializable{
@Column(name = "isInterfederatedSSOSession", nullable=false)
private boolean isInterfederatedSSOSession = false;
- @Column(name = "pendingRequestID", nullable=false)
+ @Column(name = "pendingRequestID", nullable=true)
private String pendingRequestID = "";
@Column(name = "created", updatable=false, nullable=false)