get username from authentication spring boot

www.lau‮oc.irutt‬m
get username from authentication spring boot
UserDetails userDetails = (UserDetails) SecurityContextHolder
		.getContext()
		.getAuthentication()
		.getPrincipal();
String username = userDetails.getUsername();
Created Time:2017-09-07 22:22:52  Author:lautturi