You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Henderson <jg...@metafile.com> on 2003/01/23 20:13:44 UTC

Servlet chaining, set remoteUser?

I have an existing Servlet that requires an authenticated user
(HttpServletRequest.getRemoteUser()).  However, the Servlet can now be
invoked from another application on a Domino server which the user has
already signed on to.    The Domino server will redirect the request to my
Servlet and pass the user ID in a file.  To avoid changing my original
Servlet I want to try Servlet Chaining.  However, how do I set the userID in
the redirected request stream?  Is that possible?

Thanks!
Jim Henderson




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Servlet chaining, set remoteUser?

Posted by Bill Barker <wb...@wilshire.com>.
Since this only really has a chance of working with a 2.3+ container (like
Tomcat 4.x), I'd probably use a Filter instead of chaining Servlets.
However, the idea is the same.  You create a HttpServletRequestWrapper that
overrides getRemoteUser and getUserPrincipal (and, possibly, isUserInRole)
that understands the Domino authentication.  You then pass the Wrapper along
in the chain so that the destination Servlet gets the correct values for the
above.

"Jim Henderson" <jg...@metafile.com> wrote in message
news:003301c2c313$8cdf8910$330110ac@metafile.lan...
> I have an existing Servlet that requires an authenticated user
> (HttpServletRequest.getRemoteUser()).  However, the Servlet can now be
> invoked from another application on a Domino server which the user has
> already signed on to.    The Domino server will redirect the request to my
> Servlet and pass the user ID in a file.  To avoid changing my original
> Servlet I want to try Servlet Chaining.  However, how do I set the userID
in
> the redirected request stream?  Is that possible?
>
> Thanks!
> Jim Henderson




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>