return auth;
}
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token) throws AuthenticationException {
UsernamePasswordToken upToken = (UsernamePasswordToken) token;
User user = dao().fetch(User.class, Cnd.where("name", "=", upToken.getUsername()));
if (user == null)
return null;
if (user.isLocked())
throw new LockedAccountException("Account [" + upToken.getUsername() + "] is locked.");
dao().fetchLinks(user, null);
SimpleAccount account = new SimpleAccount(upToken.getUsername(), user.getPasswd(), name);
if (user.getSalt() != null)
account.setCredentialsSalt(ByteSource.Util.bytes(user.getSalt()));
return account;
}