aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-01-07 11:03:11 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-01-07 11:03:11 +0100
commitd7404bc44ae84df98031a87052ff2d71ac960bd1 (patch)
treeac50adfc54eab9e0d2bff78f8f3e0146fada010a
parent6e01fbb21b23d187cdb169ef0be8dfc15fc6638f (diff)
downloadmoa-id-spss-d7404bc44ae84df98031a87052ff2d71ac960bd1.tar.gz
moa-id-spss-d7404bc44ae84df98031a87052ff2d71ac960bd1.tar.bz2
moa-id-spss-d7404bc44ae84df98031a87052ff2d71ac960bd1.zip
short Bugfixes, but not complete
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java4
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20TokenAction.java25
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/storage/AuthenticationSessionStoreage.java1
3 files changed, 17 insertions, 13 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java
index c616d94b3..91040dde2 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/builder/StartAuthenticationBuilder.java
@@ -44,13 +44,13 @@ public class StartAuthenticationBuilder {
AuthenticationServer.startSTORKAuthentication(req, resp, moasession);
return "";
- } else {*/
+ } else {
//normal MOA-ID authentication
Logger.debug("Starting normal MOA-ID authentication");
String getIdentityLinkForm = AuthenticationServer.getInstance().startAuthentication(moasession, req);
return getIdentityLinkForm;
- //}
+ }
}
}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20TokenAction.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20TokenAction.java
index 70f425148..d66f9cb2a 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20TokenAction.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/oauth20/OAuth20TokenAction.java
@@ -27,6 +27,7 @@ import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
import at.gv.egovernment.moa.id.auth.data.AuthenticationSession;
import at.gv.egovernment.moa.id.auth.exception.BuildException;
import at.gv.egovernment.moa.id.auth.exception.MOAIDException;
+import at.gv.egovernment.moa.id.commons.db.ConfigurationDBUtils;
import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.config.auth.OAAuthParameter;
@@ -111,7 +112,7 @@ public class OAuth20TokenAction implements IAction {
OAuth20Util.addProperytiesToJsonObject(jsonObject, params);
String jsonResponse = jsonObject.toString();
Logger.debug("JSON Response: " + jsonResponse);
-
+
// write respone to http response
httpResp.setContentType("application/json");
httpResp.setStatus(HttpServletResponse.SC_OK);
@@ -124,18 +125,20 @@ public class OAuth20TokenAction implements IAction {
throw new OAuth20ServerErrorException();
}
finally {
- if (session != null) {
- // destroy session for clean up
- try {
- Logger.debug("Going to destroy session: " + session.getSessionID());
- AuthenticationSessionStoreage.destroySession(session.getSessionID());
- }
- catch (MOADatabaseException e) {
- }
- }
+ ConfigurationDBUtils.closeSession();
+
+// if (session != null) {
+// // destroy session for clean up
+// try {
+// Logger.debug("Going to destroy session: " + session.getSessionID());
+// AuthenticationSessionStoreage.destroySession(session.getSessionID());
+// }
+// catch (MOADatabaseException e) {
+// }
+// }
}
}
-
+
/*
* (non-Javadoc)
* @see
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 e40d11128..d0c28538c 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
@@ -209,6 +209,7 @@ public class AuthenticationSessionStoreage {
//Assertion requires an unique artifact
if (result.size() != 1) {
Logger.trace("No entries found.");
+ tx.commit();
throw new MOADatabaseException("No session found with this sessionID");
}