RE: servlet authentication

2002-07-02 Thread Kevin Seguin

i could be wrong, but i think once you call sendError(), the response is committed and 
you cannot set any more headers.  try reversing the order of the 
sendError()/setHeader() calls:

 response.setHeader(WWW-Authenticate, BASIC realm=\test\);
 response.sendError(response.SC_UNAUTHORIZED);

 -Original Message-
 From: Michael Bergknoff [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 01, 2002 9:02 PM
 To: [EMAIL PROTECTED]
 Subject: 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
 htmlheadtitleApache Tomcat/4.0.3 - Error
 report/titleSTYLE!--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
 /headbodyh1Apache Tomcat/4.0.3 - HTTP Status 401
 - Unauthorized/h1HR size=1 noshadepbtype/b
 Status report/ppbmessage/b
 uUnauthorized/u/ppbdescription/b uThis
 request requires HTTP authentication
 (Unauthorized)./u/pHR size=1
 noshade/body/htmlConnection 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!?
 Sign up for SBC Yahoo! Dial - First Month Free
 http://sbc.yahoo.com
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: servlet authentication

2002-07-02 Thread Michael Bergknoff

Looks like you're right.

Thanks,
Mike

From: Kevin Seguin
Subject: RE: servlet authentication
Date: Tue, 02 Jul 2002 02:39:06 -0700

i could be wrong, but i think once you call
sendError(), the response is committed and
you cannot set any more headers.  try reversing the
order of the
sendError()/setHeader() calls:

 response.setHeader(WWW-Authenticate, BASIC
realm=\test\);
 response.sendError(response.SC_UNAUTHORIZED);

 -Original Message-
 From: Michael Bergknoff [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 01, 2002 9:02 PM
 To: [EMAIL PROTECTED]
 Subject: 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
 htmlheadtitleApache Tomcat/4.0.3 - Error
 report/titleSTYLE!--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
 /headbodyh1Apache Tomcat/4.0.3 - HTTP Status
401
 - Unauthorized/h1HR size=1
noshadepbtype/b
 Status report/ppbmessage/b
 uUnauthorized/u/ppbdescription/b
uThis
 request requires HTTP authentication
(Unauthorized)./u/pHR size=1
 noshade/body/htmlConnection 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!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




servlet authentication

2002-07-01 Thread Michael Bergknoff

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
htmlheadtitleApache Tomcat/4.0.3 - Error
report/titleSTYLE!--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
/headbodyh1Apache Tomcat/4.0.3 - HTTP Status 401
- Unauthorized/h1HR size=1 noshadepbtype/b
Status report/ppbmessage/b
uUnauthorized/u/ppbdescription/b uThis
request requires HTTP authentication
(Unauthorized)./u/pHR size=1
noshade/body/htmlConnection 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!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




JSP/Servlet: authentication

2001-01-18 Thread Sam T.

hi all 
please could someone give me hints on using jdbc [specially jdbcRleam]
and servlets or JSP for user authentication to lookup user details to
create a connection with.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]