Question : get logged-in user in Spring Security
Answered by : sonam
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
// Get user name
authentication.getName()
Code language: JavaScript (javascript)
Source : https://bhutanio.com/how-to-find-out-the-currently-logged-in-user-in-spring-boot/ | Last Update : Sat, 20 Nov 21
Question : How to find the logged-in user in Spring Boot?
Answered by : sonam
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
Source : https://bhutanio.com/how-to-find-out-the-currently-logged-in-user-in-spring-boot/ | Last Update : Sun, 28 Nov 21