5

I was trying to follow the example from the question "How does one use Basic Authentication with this library?"

Here is my getHeaders() function

@Override
public Map<String, String> getHeaders() throws AuthFailureError {
    HashMap<String, String> params = new HashMap<String, String>();
    String creds = String.format("%s:%s","MyEmail","MyPassword");
    String auth = "Digest " + Base64.encodeToString(creds.getBytes(), Base64.DEFAULT);
    params.put("Authorization", auth);
    params.put("MY-API-TOKEN", "99999999999999999999999999999999999999999999999999");
    return params;
}

But I keep getting the Error 401

I'm using Philsturgeon's Codeigniter RestServer for my RestApi

I know that:

Basic and Digest is just putting a header that looks like this "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" in Basic and more complicated in digest

But I don't seem to be able to do it. So, How can I do a Digest Authentication using Android-Volley?

Community
  • 1
  • 1
Michel Ayres
  • 5,891
  • 10
  • 63
  • 97

0 Answers0