How can I programmatically set a user in the Tomcat container? My scenario is that I want to send a 1024-bit key to a user. That user will give that key to a specific servlet. That servlet will take that key and lookup user information. I want to then let Tomcat know who the user is so that request.getRemoteUser() will work on subsequent page loads.