tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Rusnak" <martin.rus...@corinex.sk>
Subject Q: problem with authentication
Date Thu, 03 Feb 2000 08:38:47 GMT
I'm trying to use http authentication with tomcat3.0.
Method HttpServletRequest.getRemoteUser() alwais returns null.

here is code:
------
    public void service (HttpServletRequest request, HttpServletResponse
response)
        throws ServletException, IOException
    {
        String user=request.getRemoteUser();
	if(user==null||user==""){
            response.setHeader("WWW-Authenticate","Basic realm=\"My
Realm\"");
            response.sendError(401,"Unauthorized");
            out.println("Text to send if user hits Cancel button\n");
            return;
        }

        ....
------

Is there any other way to get user name?

Martin Rusnak

Mime
View raw message