i am trying to send the credentials to an SSO implemented pentaho server from a java file but i am getting an error HTTP status code 302.


The contents of the java file are---->


String pentahoServerURL = "http://localhost:8081";




Credentials defaultcreds = new UsernamePasswordCredentials("username","password");
HttpClient client =new HttpClient();


client.getState().setCredentials(null,null, defaultcreds);




response.setHeader("content","0;URL=http://localhost:8081/pentaho");