Spring boot Security 객체 참조

2024. 8. 13. 17:38Java/Spring Boot Security

Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserDetails userDetails = (UserDetails)principal;
log.debug(userDetails.getUsername());