How To Find The Logged In User In Spring Boot?

[Solved] How To Find The Logged In User In Spring Boot? | Java Frameworks Spring - Code Explorer | yomemimo.com
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

Answers related to How to find the logged in user in Spring Boot?

Code Explorer Popular Question For Java Frameworks Spring