1

I am using angular for client side and codeigniter php for backend and for rest server. When I turn on basic auth on rest server I can reach to data from client side in this way:

            method: 'GET',
            url: 'http://localhost/myDomain',
            headers: {"Authorization": "Basic " + btoa("username:password")}

But when I turn on digest I can't just change Basic to Digest and reach to data. Does anyone know why?

Thanks

Sasa
  • 553
  • 7
  • 25
  • Possible duplicate of [AngularJS and Digest HTTP Authentication](http://stackoverflow.com/questions/17531753/angularjs-and-digest-http-authentication) – Daniel Alder Jul 27 '16 at 13:22

1 Answers1

0

Basic and Digest are like different languages, you also can't say "how r u" to a Non-English-speaking person and expect a useful answer. In fact, Digest uses a Challenge Response protocol and Basic doesn't.

More clearly, your HTTP header value needs to be calculated from the username/password combo plus the previous server answer.

sequence diagram visualizing the HTTP digest authentification

Daniel Alder
  • 5,031
  • 2
  • 45
  • 55