aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
index f3495966a..800393b30 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/LogOutServlet.java
@@ -54,12 +54,14 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import at.gv.egovernment.moa.id.auth.MOAIDAuthInitializer;
+import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider;
import at.gv.egovernment.moa.id.moduls.AuthenticationManager;
import at.gv.egovernment.moa.id.moduls.RequestStorage;
import at.gv.egovernment.moa.id.moduls.SSOManager;
import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage;
import at.gv.egovernment.moa.id.util.MOAIDMessageProvider;
import at.gv.egovernment.moa.logging.Logger;
+import at.gv.egovernment.moa.util.MiscUtil;
public class LogOutServlet extends AuthServlet {
@@ -80,6 +82,11 @@ public class LogOutServlet extends AuthServlet {
//get SSO token from request
String ssoid = ssomanager.getSSOSessionID(req);
+ if (MiscUtil.isEmpty(redirectUrl))
+ //set default redirect Target
+ Logger.debug("Set default RedirectURL back to MOA-ID-Auth");
+ redirectUrl = AuthConfigurationProvider.getInstance().getPublicURLPrefix();
+
if (ssomanager.isValidSSOSession(ssoid, req)) {
//TODO: Single LogOut Implementation
@@ -88,8 +95,7 @@ public class LogOutServlet extends AuthServlet {
AuthenticationManager authmanager = AuthenticationManager.getInstance();
String moasessionid = AuthenticationSessionStoreage.getMOASessionID(ssoid);
- RequestStorage.removePendingRequest(RequestStorage.getPendingRequest(req.getSession()),
- AuthenticationSessionStoreage.getPendingRequestID(moasessionid));
+ RequestStorage.removePendingRequest(AuthenticationSessionStoreage.getPendingRequestID(moasessionid));
authmanager.logout(req, resp, moasessionid);
Logger.info("User with SSO Id " + ssoid + " is logged out and get redirect to "+ redirectUrl);
@@ -105,7 +111,7 @@ public class LogOutServlet extends AuthServlet {
}
//Redirect to Application
- resp.setStatus(301);
+ resp.setStatus(302);
resp.addHeader("Location", redirectUrl);
}