1 Reply Latest reply on May 21, 2008 6:45 PM by haefti

    How to call authenticate() directly

    haefti

      Hi!


      In my Seam application I have to test a cookie of a Not-Seam application to authenticate the user. If it is present and has some specific values the user is supposed to be authenticated in my Seam application as well.


      The cookie testing works well in the authenticator class but I don't know how to call Authenticator.authenticate() directly if the user calls a page from my application.


      To my mind using login-required="true" in the pages.xml only allows a redirect to a page where the user can click on a button or someting similar which calls the authenticate()-method.


      Is there any possibility to call Authenticator.authenticate() directly when a page is accessed so the user with the cookie can see directly the page without a login page?


      BTW, what do I have to insert in my pages.xml to protect all my pages?



      <page view-id="/*" login-required="true"/>



      does not seem to work. Only if I insert login-required="true" in every <page>-element the login is tested.


      Thanks for your help!


      Haefti

        • 1. Re: How to call authenticate() directly
          haefti

          Just to let you know, the second problem is solved.


          I don't know why but now it works as expected with:


          <page view-id="/*" login-required="true"/>




          Concerning the first question I figured out that I can call a session bean which calls Authenticator.authenticate() but calling the Authenticator directly from the view fails (of course) because it is no session bean with a local interface.


          Is there a way to call the authenticator declaratively in pages.xml or is there any other opportunity to leave out the login page?


          Thanks for your help!


          Haefti