[jboss-user] [JBoss Seam] - Re: SeamSecurity

KoniKoni do-not-reply at jboss.com
Sat Mar 10 13:54:05 EST 2007


   public boolean authenticate() {
  |         
  |         
  |         log.info("authenticating #0", identity.getUsername());
  |         try{
  |             Usr usr = (Usr) em.createQuery("from Usr where bname = :bname and passwort = :passwort")
  |             .setParameter("bname", Identity.instance().getUsername())
  |             .setParameter("passwort", Identity.instance().getPassword())
  |             .getSingleResult();
  |             
  |             if (usr.getRoles() != null) {
  |                 identity.addRole( usr.getRoles());
  |                 return true;
  |             }
  |             return false;
  |         } catch (NoResultException ex) {
  |             FacesMessages.instance().add("Benutzername/Passwort falsch!");
  |             return false;
  |         }
  |         
  |     }

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026891#4026891

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026891



More information about the jboss-user mailing list