Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

http authentication

 
Markus A Kramer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
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?
thank's,
Markus
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the getUserPrincipal, getRemoteUser methods on HttpServletRequest interface. From these you cannot get the password though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic