2 Replies Latest reply on May 26, 2008 11:13 AM by Ido Tamir

    failing to outject

    Ido Tamir Newbie

      while I am able to programatically set the authenticated user into the session, the outjected user is nowhere to be found. Why not?

      thank you very much for your answers,

      public class AuthenticatorAction implements Authenticator {
           private EntityManager em;
           private User user; //fails
           public boolean authenticate() {
                String encryptedPW = Service.getInstance().getSaltedHash(Identity.instance().getPassword());
                try {
                     User user = (User) em.createQuery(
                     "from User where username = :username and password = :password")
                     .setParameter("username", Identity.instance().getUsername())
                     .setParameter("password", encryptedPW)
                     Contexts.getSessionContext().set("authenticatedUser", user); //works
                     return true;
                catch (NoResultException ex){
                     return false;
           @Destroy @Remove
           public void destroy() {}