2 Replies Latest reply on Sep 19, 2001 3:28 AM by callum

    Getting the user

    callum

      Hey there,

      Does anyone know if there is a generic and hopefully non-proprietary means (not just in EJBs in regular java classes also) of obtaining the current user from inside the EJB tier? preferably without passing the principal info or the ejb context?

      thanks

      Callum

        • 1. Re: Getting the user
          starksm64

          No there is not. The EJBContext.getCallerPrincipal() is the only mechanism for accessing the user.

          • 2. Re: Getting the user
            callum

            Thanks Scott,

            I have implemented a solution, that though not optimal, provides the required functionality. I provide a facade - for server side java objects (not beans) - that delegates a call to a stateless session bean and retrieves the principal from the context of the bean.

            It does the job but it also highlights the fact that at some point on the server side it is likely that regular java classes are going to require access to security. The alternative is that everything that uses security must be a bean, a bit restrictive perhaps.

            Oh well...

            Callum