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

bypass basic authentication dialog box using servlet

 
carlos flamenco
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to avoid the basic authentication dialog box appearing when i access a particular part of my web server. I would like the servlet to do the basic authentication by posting a username and password.The servlet will already have the necessary username and password. Is this possible , and if so are there any example source code for this??
Any help would be greatly appreciated,
thanks
Carlos
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an excellant example in the examples for Jason Hunter's book "Java Servlet Programming (2nd Edition)" The example is for an Applet to communicate back to a servlet requiring Basic Authentication but can work with your servlet or an application. It uses a class he created called "HttpMessage" and "Base64Encode"
The examples are at http://examples.oreilly.com/jservlet2/ If you don't have a copy of his book, I recommend it! Ajith gave it 10 Horseshoes!
------------------
I Hope This Helps
Carl Trusiak, SCJP2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic