13 Replies Latest reply on Mar 30, 2006 5:40 PM by scottdawson

    signout no longer works

    jksmartt

      I have upgraded from JBoss Portal 2.0 to the latest JBoss Portal + JBoss AS 4.0.3SP1 2.2.1RC1 Release Candidate.
      It appears that in this release candidate that the signout method no longer works:

      public void processAction(JBossActionRequest request, JBossActionResponse response) throws PortletEx
      ception, IOException
       {
       response.signOut();
       }


      This doesn't give any errors but a logged in user is still logged in after calling signout.

        • 1. Re: signout no longer works
          jksmartt

          I have found what the problem is. The code above actually works. You can signout as long as you don't redirect after. So you can't say have someone signout and redirect them to the login screen. Like this:

          public void processAction(JBossActionRequest request, JBossActionResponse response) throws PortletException, IOException
           {
           response.signOut();
           response.sendRedirect("/portal/auth/");
           }


          This will not work.

          But this will (Don't redirect):

          public void processAction(JBossActionRequest request, JBossActionResponse response) throws PortletException, IOException
           {
           response.signOut();
           }


          Would be nice if we could redirect


          • 2. Re: signout no longer works

            sendRedirect cancels the signout, maybe it should throw an IllegalStateException rather.

            signOut() stay on the same page but with a non auth URL.

            I am wondering if doing a signOut(url) would make sense.

            • 3. Re: signout no longer works
              jksmartt

              That would be very nice to be able to pass in the url if someone wanted.

              • 4. Re: signout no longer works
                scottdawson

                We needed something like the signOut(url) suggested by Julien, so I've added a signOut(String destinationPage) method in JBossActionResponse. The parameter is a page reference (like "default.Test"), not a URL.

                I've added a destination parameter in the JSP (menu.jsp) to get things started:

                <portlet:actionURL windowState="normal">
                 <portlet:param name="op" value="userLogout"/>
                 <portlet:param name="destinationPage" value="default.Test"/>
                </portlet:actionURL>">
                


                Modifications have also been made to UserPortlet (to retrieve the parameter set by the JSP), and in the SignOutResult and InvokeWindowActionCommand classes. The old way still works -- signOut with no parameter will try to stay on the current page as Julien explained.

                If this seems reasonable, I can create a new entry (patch?) in the JIRA and attach the modified files.

                Regards,
                Scott Dawson
                Unisys


                • 5. Re: signout no longer works

                  have you signed the contributor agreement ?

                  • 6. Re: signout no longer works
                    scottdawson

                    Julien,
                    I signed it this morning. Let me know what the next step is.
                    Thanks,
                    Scott

                    • 7. Re: signout no longer works

                      you should submit a patch in jira and attach your changes for this as it is just a minor change.

                      • 8. Re: signout no longer works
                        scottdawson

                        Do you prefer diff files, or the .java files or something else?

                        • 9. Re: signout no longer works

                          both :-) are usefull

                          • 10. Re: signout no longer works
                            scottdawson

                            Here is the patch:
                            http://jira.jboss.com/jira/browse/JBPORTAL-621

                            Regards,
                            Scott Dawson
                            Unisys

                            • 11. Re: signout no longer works

                              Scott,

                              I have an issue with the current patch which is too specific because it takes care of pages.

                              Do you mind if rather the signout operation takes a generic URL that the portal will send redirect to instead ?

                              Page still can be resolved using the org.jboss.portlet navigation API by finding the right page (to be sure it exists) and then create a URL to this page that is placed in the sign out.

                              I know it makes extra work when implemening the portlet signout but that makes us sure that the page exist and the signout is not tied to the notion of page.

                              • 12. Re: signout no longer works
                                scottdawson

                                Julien,
                                I think the change you suggested is an improvement. So, there will be modifications in the execute method of InvokeWindowActionCommand and the code there for SignOutResult may become similar to the code for HTTPRedirectionResult. Do you agree?

                                Do you think the rest of the flow should be re-architected or are the required changes (to the patch) mostly in InvokeWindowActionCommand.execute?

                                Would you like for me to make the changes and re-submit the patch?

                                Thanks,
                                Scott

                                • 13. Re: signout no longer works
                                  scottdawson

                                  I've updated the JIRA with a new patch based on Julien's recommendations:
                                  http://jira.jboss.com/jira/browse/JBPORTAL-621

                                  Regards,
                                  Scott Dawson
                                  Unisys