예제 #1
0
  @Override
  public UserDetails loadUserByUsername(final String username) throws UsernameNotFoundException {

    CMaqUsuariosAcceso user = iUsuariosManager.findByUserName(username);
    List<GrantedAuthority> authorities = buildUserAuthority(user.getUserRole());

    return buildUserForAuthentication(user, authorities);
  }
예제 #2
0
 private User buildUserForAuthentication(
     CMaqUsuariosAcceso user, List<GrantedAuthority> authorities) {
   return new User(
       user.getUsername(), user.getPassword(), user.isEnabled(), true, true, true, authorities);
 }