You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Bergknoff <be...@yahoo.com> on 2002/06/30 18:42:51 UTC

servlet authentication

To test servlet-based authentication, I have a two
line servlet.
	response.sendError(response.SC_UNAUTHORIZED);
	response.setHeader("WWW-Authenticate", "BASIC
realm=\"test\"");

Here is the output I get:
$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /myapp/servlet
<html><head><title>Apache Tomcat/4.0.3 - Error
report</title><STYLE><!--H1{font-family :
sans-serif,Arial,Tahoma;color : white;background-color
: #0086b2;} BODY{font-family :
sans-serif,Arial,Tahoma;color : black;background-color
: white;} B{color : white;background-color : #0086b2;}
HR{color : #0086b2;} --></STYLE>
</head><body><h1>Apache Tomcat/4.0.3 - HTTP Status 401
- Unauthorized</h1><HR size="1" noshade><p><b>type</b>
Status report</p><p><b>message</b>
<u>Unauthorized</u></p><p><b>description</b> <u>This
request requires HTTP authentication
(Unauthorized).</u></p><HR size="1"
noshade></body></html>Connection closed by foreign
host.

The output contains no HTTP headers, just some Tomcat
generated HTML. Is this a bug in my servlet test or
what?

Thanks,
Mike


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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