Hi, May i know, why you want to do authentication via POST. Anyway, use URL as "http://localhost:8080/jasperserver-pro/j_spring_security_check?"+ "j_username=" + username+ "&j_password=" + password; Remove the line "con.setRequestProperty("Authorization", jasperAuth);" as you are passing credentials in the URL. Then, your code for connection object with POST should work. check the response code. If 200, build session id as below: String session_id = con.toString() + ""; int index1 = session_id.indexOf("="); int index2 = session_id.indexOf("?"); jsessionId = session_id.substring(index1 + 1, index2); return jsessionId; pass this session ID for the next request by setting request property as below for new connection object for GET method url = new URL(urlGET); HttpURLConnection getConnection = (HttpURLConnection) urlGET.openConnection(); getConnection .setRequestProperty("Cookie", "JSESSIONID=" + session_id); make sure to set Content-Type, Accept and request method as "GET" for getConnection object. Hope it helps.