use of org.springframework.security.core.authority.SimpleGrantedAuthority in project av-service by dvoraka.
the class BasicUserDetailsService method loadUserByUsername.
@Override
public UserDetails loadUserByUsername(String username) {
if ("JOHN".equals(username)) {
List<GrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
return new User("JOHN", "PASS", true, true, true, true, authorities);
} else {
throw new UsernameNotFoundException("User not found: " + username);
}
}
Aggregations