I am trying to connect to a url from a servlet using Java .net.authenticator for providing the credentials
to connect to the url but everytime I try to connect i get 401 unauthorised error.
The code inside the authenticator is never called.It seems that Weblogic is overridding this and preventing the authenticator to behave
as it should be.
Is there any particular setting in weblogic which will help resolve this or any work round available.
Below is the code I am using
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
protected PasswordAuthentication getPasswordAuthentication()
System.out.println("the authenticator is called");
return new PasswordAuthentication("domain\\username","password".toCharArray());
String urlString = "http://mymachine/ReportServer/Pages/ReportViewer.aspx?"
URL url= new URL(urlString);
HttpURLConnection repCon = (HttpURLConnection)url.openConnection();
System.out.println("the response code"+repCon.getResponseCode());
Definately Weblogic is bypassing the authenticator which is why I am geting 401 error.
please any work around for this?