On 20/02/2013 21:20, André Warnier wrote:
> Hi.
> In relation to a couple of recent posts, I have a naive question :
> 
> In a servlet, to retrieve the authenticated user-id (if any), I use
> 
> String userName = request.getRemoteUser();
> 
> Now, suppose I wanted to create a servlet filter which (under certain
> conditions), would force the current request to be authenticated as user
> "someuser", how would I do that ?
> 
> I s'pose it would too much to ask that it would just be
> 
> request.setRemoteUser("someuser");
> 
> Mmm ?

Almost, but you need to use a method that actually exists in the API.

HttpServletRequest.login(String username, String password)

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to