Java/Spring Boot Security

Spring boot Security 객체 참조

바리새인 2024. 8. 13. 17:38
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserDetails userDetails = (UserDetails)principal;
log.debug(userDetails.getUsername());