HTTP Authentication with AngularJS and Digest

I am trying to implement digest auth algorithm in angular. However, a lack of knowledge about angular queries will cause me to stop perceiving this goal. My approach is to convert the request through

$httpProvider.defaults.transformRequest 

route. But the features that I provide

 function (data, headersGetter) 

obviously no knowledge of the upcoming request is provided. Since I do not know about the request URI (but especially a method such as PUT, GET, etc.), It is not possible to calculate the correct hash hash.

Does anyone know how the transformRequest function can get the URI and method the request is targeting?

+4
source share
1 answer

In fact, this functionality is now usually provided through http://ngmodules.org/modules/angular-digest-auth

+1
source

Source: https://habr.com/ru/post/1490337/


All Articles