Ambil informasi pengguna dalam keamanan musim semi
UserDetails userDetails = (UserDetails) authentication.getPrincipal();
System.out.println("User has authorities: " + userDetails.getAuthorities());
Balaji Rengan