10 Replies Latest reply on Nov 17, 2008 4:55 PM by laurentm

    Login-logout issue

    laurentm

      Hi all
      I have a problem regarding login and logout  conversation


      I use :


      SEAM 2.1

      JBoss 4.1

      RichFaces

      And identity mecanism


      This beahvior causing my issue:


      I log out of my application

      I  attempt to log in again

      I get the message -- Session has expired

      I press the login button again and succesfully login to my application.


      I have the following
      pages.xml definition (partial)


      <navigation from-action="#{identity.logout}">
                   <end-conversation before-redirect="true"/>
                       <redirect view-id="/home.xhtml"/>
                   </navigation>
      
      



      Any ideas on how to resolve this quite anoying issue?


      Thanks in adavance


      Laurent

        • 1. Re: Login-logout issue
          lstine

          I've have the seen the same scenario. In my case, I had a view specified in the logout s:link.



          <s:link action="#{authenticator.logout}" view="/login.xhtml" 
          value="Logout" rendered="#{identity.loggedIn}"/>



          Removing the view attribute from the s:link solved it.

          • 2. Re: Login-logout issue
            laurentm

            Thanks for the reply

            It could not solve my issue because here's my button section defined in home.xhtml


            <div class="actionButtons">
                                <h:commandButton value="#{messages['Login']}" action="#{identity.login}" rendered="#{not identity.loggedIn}" styleClass="button"/>
                                <h:commandButton value="#{messages['Logout']}" action="#{identity.logout}" rendered="#{identity.loggedIn}" styleClass="button"/>
                           </div>
            


            • 3. Re: Login-logout issue
              lstine

              I was also seeing a javax.faces.application.ViewExpiredException exception. Do you get one too?

              • 4. Re: Login-logout issue
                laurentm

                In fact,
                I do!

                • 5. Re: Login-logout issue
                  lstine

                  I think that it is the same issue that I had. Of course, your case is different. It is caused by seam trying to restore the login.xhtml view when you don't want it to.


                  In my pages.xml I reduced it to the following for this issue:



                  <page view-id="*">
                     <navigation from-action="#{authenticator.logout}">
                        <redirect view-id="/login.xhtml"/>
                     </navigation>
                   </page>



                  Maybe that will help.

                  • 6. Re: Login-logout issue
                    laurentm

                    Already done like it:



                    <!-- login-logout flow -->
                     <page view-id="*">
                            <navigation>
                                <rule if-outcome="home">
                                     <end-conversation before-redirect="true"/>
                                    <redirect view-id="/home.xhtml"/>
                                </rule>
                            </navigation>
                            <navigation from-action="#{identity.logout}">
                                 <end-conversation before-redirect="true"/>
                                     <redirect view-id="/home.xhtml"/>
                                 </navigation>
                                 <navigation from-action="#{identity.login}">
                                 <end-conversation before-redirect="true"/>
                                     <redirect view-id="/details.xhtml"/>
                                 </navigation>
                        </page>
                    



                    I really feel like it is a dead-en situation...

                    • 7. Re: Login-logout issue
                      lstine

                      Have you removed this?



                      <end-conversation before-redirect="true"/>



                      • 8. Re: Login-logout issue
                        laurentm

                        Yes..

                        • 9. Re: Login-logout issue
                          joblini

                          Hi Laurent


                          Any change if before-redirect="false"?


                          Have you set log level to TRACE in log4j-config.xml?




                          • 10. Re: Login-logout issue
                            laurentm

                            Hey!


                            Ingo is in that house :)


                            Well actually


                            I did found the culprit crap.


                            You see, in 2.1.0.SP1



                            #{identity.logout}


                            Is to be considered has a property reference ( which is not existent :) )


                            So to handle the redirection correctly and solve this issue you'd have to add parenthesis to  the expression so it can be considered as action method