4 Replies Latest reply on Feb 5, 2008 10:55 AM by anil.saldhana

    Use of EJBs within LoginModule

    deanouk

      Is it possible to use an EJB within a LoginModule?

      At the moment the EJB is set to @PermitAll but the LoginModule is re-called when the EJB call is made within itself...

        • 1. Re: Use of EJBs within LoginModule
          deanouk

          After stepping through a bit more carefully...
          The EJB is successfully accessed in:
          getUsersPassword()

          Then LoginModule calls commit().
          Which calls super.commit() - which calls getRoleSets() - which on an EJB call inside the getRoleSets() goes back to getUsersPassword() which then loops on itself, over and over, and then finally fails.

          • 2. Re: Use of EJBs within LoginModule
            ragavgomatam

            Its always a little tricky. Ejb's if they are secured, then to call them you should first be jaas logged in...But if you call the ejb from a Login Module, without being logged in, you go into an indefinite loop...Its like a re-entrant call with ejb's...Situation is different if you have @PermitAll...technically it should let you through

            • 3. Re: Use of EJBs within LoginModule
              deanouk

              The EJB I'm calling is set to @PermitAll

              It appears to be on the second call to the EJB, it's very odd, but I'm desperate for a solution.

              • 4. Re: Use of EJBs within LoginModule
                anil.saldhana

                First ensure that your EJBs are working with the default JAAS configuration of "other". Then bring in your login modules.