HttpsURLConnection post problem to Siteminder login.fcc
Hello All,
I need help in debugging my issue with ca Siteminder login.fcc connection with javax.net.ssl.HttpsURLConnection java client.
I am creating HTTPSURLConnection client and POST ing my request with valid USER, PASSWORD and target parameter to https://<myDomain>.com/siteminderagent/forms/login.fcc, actually I am expecting to get redirected to success (target) page or sucessful SMSESSION as a header response.
But instead siteminder is redirecting my request to unsuccessful/ invalid credentials page.
Following is my code snippet, Please see anybody an give me vital inputs to resolve this. Any help would be appreciated a lot.
Same program I wrote using Apache commons HTTPClient library, that worked fine, however we don't want to use Apache commons for this implementation.
URL u = new URL("https://<mydomain>.com/siteminderagent/forms/login.fcc");
// Just to give proper certificate value
System.setProperty("javax.net.ssl.trustStore", "jssecacerts");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
// tried toogling this parameter
http.setInstanceFollowRedirects(true);
DataOutputStream out = new DataOutputStream(http.getOutputStream());
// Writing post data to the contents
out.writeBytes(content);
out.flush();
out.close();
InputStream ins = http.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);
String inputLine;
while ((inputLine = in.readLine()) != null)
{
System.out.println(inputLine);
}
// I am expecting SMSESSION value in cookie or any header field
Map getHeaders = http.getHeaderFields();
Set<String> headerSet = getHeaders.keySet();
for (String header : headerSet) {
System.out.println(header + ":" + getHeaders.get(header));
}
in.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
Please help me in resolving this issue, as I got stuck in resolving this.
Bookmarks