aspose file tools*
The moose likes Tomcat and the fly likes Why do I have to type in twice to log in with basic authentication? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Why do I have to type in twice to log in with basic authentication?" Watch "Why do I have to type in twice to log in with basic authentication?" New topic
Author

Why do I have to type in twice to log in with basic authentication?

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
When my web app pops up a basic authentication box, I type in the username and password, and then it bounces back with blank text boxes asking for it again. Every time when I type them in a second time it then lets me in! What's going on? Here's what I have in my server.xml:




Crazy. We have a Windows version and a Linux version of the database. I just changed my DSN over to the Linux one, and now it pops up 4 times. No, wait...sometimes it still logs you in just after 2 times, and sometimes it takes as many as 6! Also, sometimes when browsing the site, it makes you log in again in places where it didn't used to.

You see, we have a main database that drives our web app, but we've been using a MySQL db to authenticate, and we'd like to get rid of that so we can just deal with one database. However, this one is behaving strangely. Now, when clicking over to some of the other JSPs in the site, it will pop up and ask for the username and password in places it didn't used to do that (and no, it shouldn't be changing contexts or anything like that).
[ October 01, 2004: Message edited by: Stephen Huey ]
Chris Stehno
Ranch Hand

Joined: Feb 26, 2001
Posts: 180
I had this happen once when I was using Tomcat connected to Apache (named virtual server). I had two names specified for my domain www.mydomain.com and mydomain.com. I had them backwords so that when I typed in www.mydomain.com it would switch over to its default (without the www).
The authentication would request my information once for each domain (it is only valid in one domain).
Not sure if this is your problem but it is something to look at.

Hope this helps.


- Chris Stehno, SCPJ
Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
No, that's not it, but thanks. All I've found out so far is that there may have been an authentication bug in my version of Tomcat, so I should try upgrading from 4.1.27 to 4.1.29 and see if that helps.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why do I have to type in twice to log in with basic authentication?