tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: getRemoteUser()
Date Tue, 12 Aug 2003 15:04:02 GMT

Add the following to


That tells Tomcat to take its authentication information from the jk or jk2 
connector which gets it from Apache.


At 03:22 PM 8/12/2003 +0100, you wrote:
>I'm having some difficulty making the getRemoteUser() method work. It's
>possible I have missed the point of this method, but I'll explain what
>I'm trying to do anyway.
>I'm using mod_jk to map the url /lemons to a servlet which is running on
>Tomcat 1.4.27. I've got mod_jk set up okay and the mapping works fine:
>JkMount /lemons ajp13
>I have then set up a Limit directive in my apache configuration for the
>url, thus:
><Location /lemons>
>   <Limit GET PUT POST>
>     require user dave
>   </Limit>
>This works as expected. If I go to this url I am prompted for a username
>and password. If I enter dave and the correct password then the request
>is passed through to my servlet. If I enter an incorrect username and
>password I get our server's authentication/authorization failed page and
>it doesn't get anywhere near the servlet.
>Within my servlet I then want to use getRemoteUser() method of the
>HttpServletRequest object to obtain the username which was supplied.
>Whenever I try this though, it always returns null. The request does
>contain an authorization header, but I can't seem to get a username out
>of it.
>Any ideas please? (If I need to RTFM, please point me in the right
>Thanks, Dave
>To unsubscribe, e-mail:
>For additional commands, e-mail:

View raw message