Hi All,

I am trying to get the output from authenticated web page.They are using Digest authentication.


When i sent first request i am getting 401 error along with authenticate header(realm,nonce,algorithm,domain,qop)

through that header i am calculating responce as follows

md5 = MessageDigest.getInstance("MD5");
md5.reset();
String ha1 = DigestUtils.md5Hex(data.split(":")[0] + ":" + "Private" + ":" + data.split(":")[1]);
String ha2 = DigestUtils.md5Hex("GET:/en_US/fashion.html");

String res= DigestUtils.md5Hex(ha1+":"+nonce+":"+"00000001"+": "
+"f9c76ebfb99f218b7468479d3dbd5f14"+":"+"auth:"+ha 2);
md5.update(res.getBytes(),0,res.length());
System.out.println(res);

newHead = "Autorization: Digest username=\"ga-keynote\",realm=\"Private\",nonce=\""+nonce+"\",ur i=\"/en_US/fashion.html\",cnonce=\"f9c76ebfb99f218b7468479d3d bd5f14\",nc=00000001,algorithm=MD5,response=\"8e9c 8303d2ea9120f8f133e6bd2dbd85\",qop=\"auth\"";
System.out.println("newHead::"+newHead);
cookieMonster.addBasicAuthData(host, realm, res);
AuthUri au = new AuthUri("auth", null, page.uri.label, page.uri.acceptable);
AuthUriAction aua = new AuthUriAction(au, new String []{data,realm}, theUser, mainUrl);
channel.authPageInfo(theUser, aua, mainUrl.toString());


and sending the new header (newHead) as request but still i am getting the 401 error.

can you please help me.

Thanks,
Vishnu