spring secuirity generating JWT token code example
Example: get username from jwt token request spring boot
UserDetails userDetails = (UserDetails) SecurityContextHolder.getContext().getAuthentication()
.getPrincipal();
String username = userDetails.getUsername();