@Override public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException { CMaqUsuariosAcceso user = iUsuariosManager.findByUserName(username); List<GrantedAuthority> authorities = buildUserAuthority(user.getUserRole()); return buildUserForAuthentication(user, authorities); }
private User buildUserForAuthentication( CMaqUsuariosAcceso user, List<GrantedAuthority> authorities) { return new User( user.getUsername(), user.getPassword(), user.isEnabled(), true, true, true, authorities); }