File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes how do I use the standard authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how do I use the standard authentication " Watch "how do I use the standard authentication " New topic

how do I use the standard authentication

jonathan Greens
Ranch Hand

Joined: Apr 07, 2004
Posts: 139
sometimes when I go to certain secure sites, there will be a native popup initiated by the browser to input user name and password. this is similar to when you go to an ftp site, it sometimes require you to log in. How does this work? How would I initiate this from the server side?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
It's called Basic Authentication. And, it's implemented by you setting the appropriate header and status in your resoponse back to the client. Another way is to just specify via your deploment descriptor (web.xml) which resources are protected. Just search the net or take a look at the example in chapter 4 of the following very good book.

Core Servlets

So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: how do I use the standard authentication
It's not a secret anymore!