}
if(name.startsWith("[direct]")) {
name = name.substring(8);
}
LoggedUser user = new LoggedUser(name,password);
if (user.authorize()) {
List<GrantedAuthority> grantedAuths = new ArrayList<GrantedAuthority>();
grantedAuths.add(new SimpleGrantedAuthority("ROLE_USER"));
Authentication auth = new MyAuthenticationToken(name, password, grantedAuths,user);
return auth;
} else {