This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Authentication not happening in IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Authentication not happening in IE" Watch "Authentication not happening in IE" New topic

Authentication not happening in IE

Jody Seigle

Joined: Sep 29, 2000
Posts: 24
I'm attempting to provide basic authentication using a simple servlet. The code should display a dialog prompting for username and password. If Cancel is pressed then an error page will be displayed. The following code accomplishes this in Netscape :
resp is a HttpServletResponse

However the dialog box does not display in Internet Explorer, the error page immediately displays. I've gotten around this by using the PrintStream in the HttpServletResponse and calling setStatus without the error page but I would like to know why this is occurring. This is only happening with a recent upgrade to the servlet API version 2.2.
I've found this problem posted on sun's java forums with no solution. Thanks for any help.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Which application server are you using? If it supports basic authentication (and it should!) you can get everything you want via configuration rather than having to code it.
Security via configuration is the prefered mechanism since it covers a range of resources rather than having to protect each page separately.
Jody Seigle

Joined: Sep 29, 2000
Posts: 24
No app server. Just Netscape Enterprise web server 6.0 and HTML pages.
It is sorta covered in the JavaRanch Style Guide.
subject: Authentication not happening in IE
Similar Threads
The method isEmpty() is undefined for the type String
Weird error uploading file via https
error-page with tomcat 4.1
Studying HeadFirst book: cannot make authentification