I am using spring security for authentication and successfully able to get User object (org.springframework.security.core.userdetails.User) anywhere I
User
org.springframework.security.core.userdetails.User
customUserDetailsService will override loadUserByUsername like below
@Override public UserDetails loadUserByUsername(String username) { return customUser; // where customUser extends org.springframework.security.core.userdetails.User }
You can have custom fields under customUser