Ravi Nori has uploaded a new change for review.

Change subject: ovirt-reports: Reports should use current sessionID
......................................................................

ovirt-reports: Reports should use current sessionID

Reports should use the new sessionID
to get session user from engine if
the sessionID has changed

Change-Id: I2e7a83b80144696639228889494a929fe4480d0a
Bug-Url: https://bugzilla.redhat.com/1116851
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M 
ovirt-engine-reports/EngineAuthentication/src/main/java/org/ovirt/authentication/EngineSimplePreAuthFilter.java
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/07/33307/1

diff --git 
a/ovirt-engine-reports/EngineAuthentication/src/main/java/org/ovirt/authentication/EngineSimplePreAuthFilter.java
 
b/ovirt-engine-reports/EngineAuthentication/src/main/java/org/ovirt/authentication/EngineSimplePreAuthFilter.java
index e69c5e7..605ec7e 100644
--- 
a/ovirt-engine-reports/EngineAuthentication/src/main/java/org/ovirt/authentication/EngineSimplePreAuthFilter.java
+++ 
b/ovirt-engine-reports/EngineAuthentication/src/main/java/org/ovirt/authentication/EngineSimplePreAuthFilter.java
@@ -168,7 +168,14 @@
                     // Checking if we need to re-check the session, and acting 
accordingly
                     if (userDetails.isRecheckSessionIdNeeded()) {
                         logger.debug("Rechecking session is needed");
-                        UsernamePasswordAuthenticationToken token = 
getAuthRequest(request, userDetails.getUserSessionID());
+                        // if the sessionID has changed
+                        String reqSessionID = 
request.getParameter("sessionID");
+                        String sessionID = userDetails.getUserSessionID();
+                        if (reqSessionID != null && 
!sessionID.equals(reqSessionID)) {
+                            logger.debug("sessionID has changed, using new 
sessionID.");
+                            sessionID = reqSessionID;
+                        }
+                        UsernamePasswordAuthenticationToken token = 
getAuthRequest(request, sessionID);
                         // if the token is null then it means we failed 
authentication
                         if (token == null) {
                             logger.debug("Returned token is null. Session was 
not valid. Setting authenticated to false");
@@ -253,7 +260,7 @@
 
             // Checking the result
             if (servletConnection.getResponseCode() != 
HttpURLConnection.HTTP_OK) {
-                logger.error("GetSessionUser servlet returned " + 
servletConnection.getResponseCode());
+                logger.error("GetSessionUser servlet returned " + 
servletConnection.getResponseCode() + " for sessionID " + sessionID);
                 return null;
             }
 


-- 
To view, visit http://gerrit.ovirt.org/33307
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e7a83b80144696639228889494a929fe4480d0a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-reports
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <rn...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to