2 Replies Latest reply on Mar 1, 2008 12:17 PM by jagin

    NotLoggedInException and JAAS configuration

      There is something strange with s:hasRole


      I have something like this in component.xml


           <security:identity authenticate-method="#{authenticator.authenticate}"
                jaas-config-name="myRealm"
                security-rules="#{securityRules}" />



      I'm using jaas configuration.


      In menu.xhtml i have:


             

      <s:link view="/users.xhtml" value="Users" propagation="none" rendered="#{s:hasRole('admin')}"/>



      After loggin as an admin user i can see Users link and all is ok. But after logout i got NotLoggedInException. After Refresh button the page is loaded properly.


      Changing menu.xhtml like:


      <s:link view="/users.xhtml" value="Users" propagation="none" rendered="#{identity.loggedIn and s:hasRole('admin')}"/>



      solved the problem.


      This problem is only with jaas-config-name in components.xml


      Am i doing something wrong or it is a bug?


      Regards


      Jarek

        • 1. Re: NotLoggedInException and JAAS configuration
          keithnaas

          Can you provide the stack trace for the NotLoggedInException?


          Thanks

          • 2. Re: NotLoggedInException and JAAS configuration

            Hmmmm, in the mean time i did something (i don't know what) and the exception is gone but there is still something wron with Jaas (or maybe with s:hasRole).


            no i have links in the menu like this:


                    <s:link view="/users.xhtml" value="User" propagation="none" rendered="#{s:hasRole('admin')}"/>
                    <s:link view="/messages.xhtml" value="Messages" propagation="none" rendered="#{identity.loggedIn}"/>
            



            After loggout the 'User' menu is still visible ('Messages' is not). After refreshing the page the 'User' menu is gone.


            If i want the menu to work properly i have to type this:


            rendered="#{identity.loggedIn and s:hasRole('admin')}"