2 Replies Latest reply on May 24, 2003 9:21 AM by Peter Doornbosch

    How to use an EJB to authenticate a user?

    Luiz-Otavio Zorzella Newbie

      I'd like to call a "myEjb.getPassword (String username)" method in my MyLoginModule class for it to authenticate the user, but, of course, as I turned JAAS on, I can't call that method without being authorized first, which needs to call that method, etc.

      Declaring the method "unchecked", of course, will not work, as unchecked relates to authorization, not authentication. I also tried to fake a role before I call getPassword, but that does not seem to work either:

      SimplePrincipal runAsRole = new SimplePrincipal("admin");
      SecurityAssociation.pushRunAsRole(runAsRole);

      Is there any way to use an EJB to authenticate a user?

      Zorzella