【发布时间】:2016-03-07 06:58:09
【问题描述】:
我想将 Http Digest 与 Volley 一起使用。到目前为止,我使用了以下代码:
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
HashMap<String, String> params = new HashMap<String, String>();
String creds = String.format("%s:%s","admin","mypass");
String auth = "Digest " + Base64.encodeToString(creds.getBytes(), Base64.NO_WRAP);
params.put("Authorization", "Digest " +auth);
return params;
}
到目前为止,我从服务器收到了错误凭据的响应,这意味着身份验证正在工作,但只有错误的凭据通过。但我的凭据是正确的。
【问题讨论】:
-
听起来不错。不过,我没有看到任何问题。
-
我没有得到任何结果。只有错误的凭据。我认为我传递凭据的方式是错误的。
标签: android android-volley http-authentication http-digest