title: How to get active user's UserDetails
body: <p>In my controllers, when I need the active (logged in) user, I am doing the following to get my <code>UserDetails</code> implementation:</p>
  
  <pre><code>User activeUser = (User)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
  log.debug(activeUser.getSomeCustomField());
  </code></pre>
  
  <p>It works fine, but I would think Spring could make life easier in a case like this. Is there a way to have the <code>UserDetails</code> autowired into either the controller or the method?</p>
  
  <p>For example, something like:</p>
  
  <pre><code>public ModelAndView someRequestHandler(Principal principal) { ... }
  </code></pre>
  
  <p>But instead of getting the <code>UsernamePasswordAuthenticationToken</code>, I get a <code>UserDetails</code> instead?</p>
  
  <p>I'm looking for an elegant solution. Any ideas?</p>