Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-29871

6.05 AutoLogin not working in 6.1 GA2 when LIve Users Enabled

    Details

      Description

      I finally figured out what was breaking my autologin in 6.1.1. In the com.liferay.portal.servlet.filters.autologin.AutoLoginFilter the following code had been added to the to the getLoginRemoteUser method:

      else if (PropsValues.LIVE_USERS_ENABLED) {
      UserTracker userTracker =
      UserTrackerLocalServiceUtil.fetchUserTracker(userId);

      if ((userTracker == null) &&
      (session.getAttribute(WebKeys.USER) == null))

      { session.invalidate(); return null; }

      }
      I do have live users enabled so this new code inconveniently invalidated my user session. Commenting out this code and redeploying this class as part of my extension allowed my autologin to now work. I'm not sure why live users enabled is now being check in this method but this will probably break any autologin if live users are enabled. This was the only thing that seem to be different between the 6.0 version and the 6.1 version of the getLoginRemoteUser method in the com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.

      One other thing I noticed is that this code passes the userId to the UserTrackerLocalServiceUtil.fetchUserTracker method. This doesn't seem to be correct because the javadocs says that the argument should be the userTrackerId, which is not the same as the userId. I think that passing the userId will always cause the method to return null. This new code just doesn't make any sense to me.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                shinn.lok Shinn Lok
                Reporter:
                bgosse Bill Gosse (Inactive)
                Participants of an Issue:
                Recent user:
                Esther Sanz
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 2 weeks ago

                  Packages

                  Version Package
                  6.1.30 EE GA3
                  6.2.0 CE M2