1

Got following problem with HTTP_DIGEST authorization via Restlet framework on Android.

05-20 18:39:14.623: W/System.err(4584): Challenge scheme HTTP_DIGEST not supported by the Restlet engine. 05-20 18:39:17.498: W/System.err(4584): Couldn't find any helper support the HTTP_Digest challenge scheme.

Part code that is executed on client and gives above error

clientResource =new ClientResource("http://example.com/position");
try{
clientResource.wrap(MailResource.class);
ChallengeResponse challengeResponse = new ChallengeResponse(ChallengeScheme.HTTP_DIGEST,
"1671046999",
"tiger");      
clientResource.setChallengeResponse(challengeResponse);
clientResource.get();
}
catch (Exception e)
{
e.printStackTrace();
}

Checked that resource via browser and authorization seems to be fine.

Any advices?:)

Google doesn't brought up anything usable.

Cheers!

mrtworo
  • 13
  • 3

1 Answers1

0

First, you should add the jar file org.restlet.ext.crypto.jar from the Restlet Android edition to your libs folder. But you have probably done that already. Unfortunately, the Restlet auto discovery mechanism for connectors and converters provided as extensions does not work properly in Android. This is because the jars are repackaged in the apk file and loose their metadata. So, you will have to manually configure the extensions you use like the one supporting HTTP Digest authentication.

Engine.getInstance().getRegisteredAuthenticators().add(new HttpDigestHelper());

I was able to reproduce your problem and this line of code fixed it.

Olivier C
  • 1,151
  • 10
  • 11