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

    Getting the user

    callumw Newbie

      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?



        • 1. Re: Getting the user
          Scott Stark Master

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

          • 2. Re: Getting the user
            callumw Newbie

            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...