title: Setting User Principal in filter
body: <p>I have an authentication filter that implements filter.</p>
  
  <p>by typcasting ServletRequest to HTTPServletRequest i can get the userPrincipal. </p>
  
  <pre><code>public void doFilter(ServletRequest request, ServletResponse response, 
  FilterChain chain)
          throws IOException, ServletException {
  
  
  
      HttpServletRequest httpServletRequest = (HttpServletRequest) request;
  
   // code to resolve user name from apikey
  
      Principal principal = httpServletRequest.getUserPrincipal();
  </code></pre>
  
  <p>My question is how do i set the Principal? so that i can pass in the authenticated users name;</p>
  
  <p>or should i just pass the name as an additional parameter using HttpServletRequestWrapper?</p>