diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-10-07 13:23:08 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2013-10-07 13:23:08 +0200 |
commit | 663ad546237fe9102c97e0eed2970e703d3034d9 (patch) | |
tree | 5c4ecf3fd1a1a2ed3e55958e926b972584962f5e /id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls | |
parent | b0f09b21746380c80b738a051f313caf0b0b684d (diff) | |
download | moa-id-spss-663ad546237fe9102c97e0eed2970e703d3034d9.tar.gz moa-id-spss-663ad546237fe9102c97e0eed2970e703d3034d9.tar.bz2 moa-id-spss-663ad546237fe9102c97e0eed2970e703d3034d9.zip |
Code CleanUP
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls')
3 files changed, 2 insertions, 78 deletions
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 4f901fcc8..cafafddb7 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 @@ -7,7 +7,6 @@ import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; import at.gv.egovernment.moa.id.auth.builder.LoginFormBuilder; import at.gv.egovernment.moa.id.auth.builder.SendAssertionFormBuilder; @@ -16,15 +15,12 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.BuildException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; -import at.gv.egovernment.moa.id.auth.exception.WrongParametersException; import at.gv.egovernment.moa.id.auth.parser.StartAuthentificationParameterParser; import at.gv.egovernment.moa.id.auth.servlet.AuthServlet; import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException; -import at.gv.egovernment.moa.id.config.OAParameter; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; -import at.gv.egovernment.moa.id.util.HTTPSessionUtils; import at.gv.egovernment.moa.id.util.ParamValidatorUtils; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.StringUtils; @@ -48,61 +44,6 @@ public class AuthenticationManager extends AuthServlet { } -// public AuthenticationSession getAuthenticationSession( -// HttpSession session) { -// String sessionID = HTTPSessionUtils.getHTTPSessionString(session, -// MOA_SESSION, null); -// if (sessionID != null) { -// try { -// return AuthenticationSessionStoreage.getSession(sessionID); -// -// } catch (MOADatabaseException e) { -// return null; -// } -// } -// return null; -// } - -// /** -// * Checks if the session is authenticated -// * -// * @param request -// * @param response -// * @return -// */ -// public boolean isAuthenticated(HttpServletRequest request, -// HttpServletResponse response) { -// Logger.info("Checking authentication"); -// -// HttpSession session = request.getSession(); -// -// String moaSessionID = HTTPSessionUtils.getHTTPSessionString(session, MOA_SESSION, null); -// -// if(moaSessionID == null) { -// Logger.info("NO MOA Session to logout"); -// return false; -// } -// -//// AuthenticationSession authSession; -//// try { -//// authSession = AuthenticationSessionStoreage -//// .getSession(moaSessionID); -//// -//// } catch (MOADatabaseException e) { -//// Logger.info("NO MOA Authentication data for ID " + moaSessionID); -//// return false; -//// } -//// -//// if(authSession == null) { -//// Logger.info("NO MOA Authentication data for ID " + moaSessionID); -//// return false; -//// } -//// -//// return authSession.isAuthenticated(); -// -// return AuthenticationSessionStoreage.isAuthenticated(moaSessionID); -// } - /** * Checks if this request can authenticate a MOA Session * @@ -112,9 +53,7 @@ public class AuthenticationManager extends AuthServlet { */ public boolean tryPerformAuthentication(HttpServletRequest request, HttpServletResponse response) { - - HttpSession session = request.getSession(); - + String sessionID = (String) request.getParameter(PARAM_SESSIONID); if (sessionID != null) { Logger.info("got MOASession: " + sessionID); @@ -134,8 +73,6 @@ public class AuthenticationManager extends AuthServlet { AuthenticationSessionStoreage.storeSession(authSession); -// HTTPSessionUtils.setHTTPSessionString(session, MOA_SESSION, -// sessionID); return true; // got authenticated } } @@ -153,10 +90,6 @@ public class AuthenticationManager extends AuthServlet { HttpServletResponse response, String moaSessionID) { Logger.info("Logout"); - HttpSession session = request.getSession(); - - //String moaSessionID = HTTPSessionUtils.getHTTPSessionString(session, MOA_SESSION, null); - if(moaSessionID == null) { moaSessionID = (String) request.getParameter(PARAM_SESSIONID); } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java index d33d4693d..d36cf0c5b 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/RequestStorage.java @@ -1,6 +1,5 @@ package at.gv.egovernment.moa.id.moduls; -import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; @@ -52,16 +51,12 @@ public class RequestStorage { if (requestmap != null && requestID != null) { synchronized (requestmap) { - - //Map<String, IRequest> requestmap = getPendingRequest(session); - + if (requestmap.containsKey(requestID)) { requestmap.remove(requestID); Logger.debug(RequestStorage.class.getName()+": Remove PendingRequest with ID " + requestID); } - - //setPendingRequest(session, requestmap); } } } diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java index 038999c19..7008239ab 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java @@ -1,7 +1,5 @@ package at.gv.egovernment.moa.id.moduls; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; import java.util.List; import javax.servlet.http.Cookie; @@ -11,14 +9,12 @@ import javax.servlet.http.HttpServletResponse; import org.hibernate.Query; import org.hibernate.Session; -import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.commons.db.MOASessionDBUtils; import at.gv.egovernment.moa.id.commons.db.dao.session.AuthenticatedSessionStore; import at.gv.egovernment.moa.id.commons.db.dao.session.OldSSOSessionIDStore; import at.gv.egovernment.moa.id.config.ConfigurationException; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.storage.AuthenticationSessionStoreage; -import at.gv.egovernment.moa.id.util.HTTPSessionUtils; import at.gv.egovernment.moa.id.util.Random; import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.util.MiscUtil; |