This content has been marked as final.
Show 4 replies
-
1. Re: Unable to authenticate in 1.1.7RC1 : is it a regression?
fernando_jmt Feb 26, 2007 8:18 AM (in response to alex.kozlenkov)Could you paste your Authenticator class code.
I got the same error time ago, I would like to see if the code you have is similar. -
2. Re: Unable to authenticate in 1.1.7RC1 : is it a regression?
baz Feb 26, 2007 8:29 AM (in response to alex.kozlenkov)There are several changes.
1.
it is now
Identity.instance().addRole
instead of
Identity.addRole
2. the #{identity.login} returns now loggedIn instead of success
It is best to reread the new documentation and compare -
3. Re: Unable to authenticate in 1.1.7RC1 : is it a regression?
alex.kozlenkov Feb 26, 2007 8:59 AM (in response to alex.kozlenkov)Thanks for this help. It works now with the code below:
public boolean authenticate() { try { User user0 = (User) entityManager.createQuery( "from User where username = :username") .setParameter("username", Identity.instance().getUsername()) .getSingleResult(); if ( !compareHash( user0.getHashedPassword(), Identity.instance().getPassword() ) ) { return false; } user = user0; if( user.getRoles() != null ) { for (UserRole r : user.getRoles()) Identity.instance().addRole(r.getName()); } return true; } catch (NoResultException ex) { log.warn("Invalid username/password"); return false; } }
Can anyone clarify why it fails with identity injected via @In--it used to work before?
Thanks--Alex -
4. Re: Unable to authenticate in 1.1.7RC1 : is it a regression?
mariuszs Feb 26, 2007 9:22 AM (in response to alex.kozlenkov)Im using @In for Identity and this works for me very good.