I'm using Spring Boot and Spring Security.
I would like to get current authenticated user data inside my userController (not only the name, username, password and authorities)
I found on differents links I can use Principal in my requestMapping method. But how can I data on this principal please ?
If I run in debug mode I can see all data I need inside the Principal variable.
@GetMapping("/users")
public ResponseEntity<?> getAllUsers(Principal principal) {
return this.userService.getAllUsers();
}