title: How do I set the remote user in Tomcat?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7553967/getting-a-value-from-httpservletrequest-getremoteuser-in-tomcat-without-modify">Getting a value from HttpServletRequest.getRemoteUser() in Tomcat without modifying application</a>  </p>
  </blockquote>
  
  
  
  <p>Short version: How can I configure Tomcat to use a specific name (say, <code>"johndoe"</code>) as the remote user name?</p>
  
  <p>The details: I'm working on a Java web application that will be deployed to production using Tomcat.  The production server is configured to prompt the user for authentication before they ever reach this application, so the app will only need to use something like the <code>javax.servlet.http.HttpServletRequest</code> method <code>getRemoteUser()</code> to get the user's name.  This works very well, in fact.  It's already been tested.</p>
  
  <p>The problem is that it's not practical (for various reasons) to install this authentication process on my development machine.  I'd also like to avoid adding special-purpose code in the application just to accommodate my local testing.  I thought that it would be best if I could just force the username I want to test with into Tomcat's configuration.  Then the <code>getRemoteUser()</code> would return <code>"johndoe"</code> every time.  Of course, in production, that username wouldn't be forced into the environment, the actual authentication process would run instead.</p>
  
  <p>I can't figure out how to configure that username into Tomcat, though.  Any suggestions?</p>