Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android中的Restlet HTTP_摘要授权_Android_Authorization_Restlet 2.0_Http Digest - Fatal编程技术网

android中的Restlet HTTP_摘要授权

android中的Restlet HTTP_摘要授权,android,authorization,restlet-2.0,http-digest,Android,Authorization,Restlet 2.0,Http Digest,通过Android上的Restlet框架进行HTTP_摘要授权时出现以下问题 05-20 18:39:14.623:W/System.err(4584):Restlet引擎不支持质询方案HTTP_摘要。 05-20 18:39:17.498:W/System.err(4584):找不到任何支持HTTP_摘要挑战方案的帮助程序 在客户端上执行并给出上述错误的部件代码 clientResource =new ClientResource("http://example.com/position");

通过Android上的Restlet框架进行HTTP_摘要授权时出现以下问题

05-20 18:39:14.623:W/System.err(4584):Restlet引擎不支持质询方案HTTP_摘要。 05-20 18:39:17.498:W/System.err(4584):找不到任何支持HTTP_摘要挑战方案的帮助程序

在客户端上执行并给出上述错误的部件代码

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();
}
通过浏览器和授权检查资源是否正常

有什么建议吗?:)

谷歌没有提供任何有用的东西


干杯

首先,您应该将restleandroid版本中的jar文件org.restlet.ext.crypto.jar添加到libs文件夹中。但你可能已经这么做了。不幸的是,作为扩展提供的用于连接器和转换器的Restlet自动发现机制在Android中无法正常工作。这是因为JAR在apk文件中被重新打包,并且丢失了它们的元数据。因此,您必须手动配置所使用的扩展,就像支持HTTP摘要身份验证的扩展一样

Engine.getInstance().getRegisteredAuthenticators().add(new HttpDigestHelper());
我能够重现您的问题,这行代码修复了它