petro.sidlovskyy
petro.sidlovskyy

Reputation: 5103

Digest authentication using HttpURLConnection

I am hosting my java application on GAE. I have to download some external RSS page and parse it. The problem is external site requires digest authentication. Is there any way to do digest authentication using HttpURLConnection class. I am not able to use HTTPClient as it is not mentioned in GAE JRE White List

Thanks beforehand for any help

Upvotes: 2

Views: 1557

Answers (2)

yves amsellem
yves amsellem

Reputation: 7244

You can also use Jersey-Client, it is gae compatible and much easier than HttpClient:

WebResource resource = Client.create().resource("http/../uri");
resource.addFilter(new HTTPDigestAuthFilter(login, password));
ClientResponse response = resource.get(ClientResponse.class);

assertTrue(response.getStatus() == 200);
assertNotNull(response.getEntity(String.class));

Upvotes: -1

systempuntoout
systempuntoout

Reputation: 74134

Have a look to this wrapper; it allows to use Java HttpClient on Google App Engine.

More info here.

Upvotes: 1

Related Questions