Answers for "spring security restful controller check user"

0

check authorities spring

@GetMapping("/users")
public String getUsers() {
    UserDetails details = userDetailsService.loadUserByUsername("mike");
    if (details != null && details.getAuthorities().stream()
      .anyMatch(a -> a.getAuthority().equals("ADMIN"))) {
        // ...
    }
}
Posted by: Guest on December-20-2020
0

check authorities spring

@GetMapping("/users")
public String getUsers() {
    UserDetails details = userDetailsService.loadUserByUsername("mike");
    if (details != null && details.getAuthorities().stream()
      .anyMatch(a -> a.getAuthority().equals("ADMIN"))) {
        // ...
    }
}
Posted by: Guest on December-20-2020

Code answers related to "spring security restful controller check user"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language