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

User not re-directed to the file after login using auto.login.hooks

    Details

    • Fix Priority:
      2

      Description

      Step to reproduce:
      1) login with "test@liferay.com" and create a page with name "docs".
      2) Add "Documents and media" portlet on docs page.
      3) Add any file and capture the corresponding fileEntryId (let us assume fileEntryId to be 10639).
      4) Now log out and hit localhost:8080/c/document_library/find_file_entry?fileEntryId=10639. And you can see the file.
      5) Since we want user to be authenticated before viewing this file, we are removing the path "/document_library/find_file_entry" from property "auth.public.paths" and add we are adding it to property "auth.forward.last.paths" [portal-ext.properties attached]. Restart the server.
      6) Now hit localhost:8080/c/document_library/find_file_entry?fileEntryId=10639 and it will ask you for login. After login user is redirected to the file. So far so good.
      7) Now with same above configuration, try to use autologin functionality with BasicAuthHeaderAutoLogin of liferay. Add "auto.login.hooks=com.liferay.portal.security.auth.BasicAuthHeaderAutoLogin" in portal-ext.properties along with above properties.
      8) Restart the server.
      9) Open browser and clean previous sessions if any.
      10) Add "open modifyHeaders" add on in your browser (firefox) as mentioned in the comment to the BasicAuthHeaderAutoLogin to test auto login hook.
      Configure Modify Headers to add a basic authentication header. Tools > Modify Headers.
      In the Modify Headers window select the Add drop down. Type
      in "Authorization" as header name and Type in "Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0"
      as header value. Click the Add button.
      Note : Basic dGVzdEBsaWZlcmF5LmNvbTp0ZXN0 is the Base64 encoded string for test@liferay.com:test
      11) Make sure your header modification is enabled and then hit localhost:8080/c/document_library/find_file_entry?fileEntryId=10639.
      12) Instead of showing the file it takes you to the home page.
      13) Now disable the header modification or stop the open modifiers and logout from current session if any. Hit localhost:8080/c/document_library/find_file_entry?fileEntryId=10639, it will ask you for login and then after login it shows the file.

      So it does not work with auto.login.hooks.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hong.zhao Hong Zhao (Inactive)
              Reporter:
              hai.yu Hai Yu
              Participants of an Issue:
              Recent user:
              Nóra Szél
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                37 weeks, 3 days ago

                  Packages

                  Version Package