This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Servlets and the fly likes http authentication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "http authentication" Watch "http authentication" New topic

http authentication

Markus A Kramer

Joined: Aug 13, 2003
Posts: 1
I'm trying to protect one of my servlets via HTTP basic authentiication.
of course, this is possible through the server.
but, is there are way a servlet can access the username and password the visitor entered?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

You can use the getUserPrincipal, getRemoteUser methods on HttpServletRequest interface. From these you cannot get the password though.

I agree. Here's the link:
subject: http authentication
It's not a secret anymore!