Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

basic windows authentication

 
Prabhakar Pentela
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have JSP Page with login link that point to the login.asp that resides on the IIS webserver. I protected this page with basic authentication.When the user clicks the link, windowns login popup will be prompted. If everything is okay then my login.asp will redircet to the following link.
responce.redirect(http:\\localhost:7001\loginaction?username=text

my problem is once the user is logged out, i am sending to. home page. If he click the login link once again i am not getting the popup but it is successfully going to the application. Anybody can help me how can i force this one in my code.

Thanks,
Prabhakar P
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're probably loggin out by using a "session.invalidate()".

Basic authentication works differently, it adds its own Cookie to the HTTP header, and you need to remove this as well, otherwise your application will always accept them as authenticated.

The name of the cookie you need to clear is 'Authorization'.

Use cookie.setMaxAge(0) to delete a Cookie, but you may need to check the API to find how to get the cookies and then find the correct one to delete.

Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic