3 Replies Latest reply on Aug 22, 2004 3:24 AM by Jian Suo

    accessing secured page

    Joachim Van der Auwera Expert

      I have a servlet which is secured, and a program which needs to access that servlet.

      When the servlet is secured using BASIC authentication, I can easily pass my credentials using the following code

       Authenticator.setDefault( new Authenticator()
       protected PasswordAuthentication getPasswordAuthentication()
       return new PasswordAuthentication( login, pass.toCharArray() );
       } );

      However, I changed my servlet to FORM based authentication for a better user experience. Now my automatic authentication no longer works, and the client code gets the login page instead of the actual result.

      Is there a way to send my credentials to the servlet to avoid trying to interpret the login page etc?

      Thanks for the help,