Hi I have done back-end authentication and able to authenticate with response_code =302 and location =Pentaho/home.
after this I am accessing pentaho dashboard from browser and getting login popup window.Please help me how can I set the authentication cookies in browser so that I can access dashboard. Please note I am using Iframe to access pentaho dashboard.
below is my authentication code in back-end.
String loginUrl = pantahoBridgePath+"/pentaho/j_spring_security_check";
HttpClient client = new HttpClient();
HttpMethod method = new PostMethod(loginUrl);
NameValuePair[] nameValuePair = new NameValuePair[2];
nameValuePair[0] = new NameValuePair("j_username",dashboardUsername);
nameValuePair[1] = new NameValuePair("j_password",dashboardPassword);
method.setRequestHeader("Content-Type", "x-www-form-urlencoded");
System.out.println("dashboardUsername----------------"+dashboardUsername);
System.out.println("dashboardPassword----------------"+dashboardPassword);
method.setQueryString(nameValuePair);
int responseCode = client.executeMethod(method);
for(Header header: method.getResponseHeaders()){
System.out.println("Header: "+header.getName()+"==="+header.getValue());
}
String locationHeader = method.getResponseHeader("Location").getValue();
String setCookie = method.getResponseHeader("Set-Cookie").getValue();
System.out.println("Response Code=====>"+responseCode); -------------302
System.out.println("locationHeader=====>"+locationHeader);-----------------Pentaho/home
Please let me know how to set cookies of above authentication in browser .is there any specific format for cookies to set in cookie. Please provide any example .