问题
I am trying to implement the digest auth algorithm in angular. However, the lack of knowledge about the requests angular will send stops me from perceiving that goal. My approach is to transform the request via the
$httpProvider.defaults.transformRequest
route. But the functions I provide
function (data, headersGetter)
obviously is not provided with any knowledge about the upcoming request. Since I have no knowledge about the request URI (but especially the method, such as PUT, GET etc.)at all it is impossible to calculate a correct digest hash.
Does anybody know how a transformRequest function can get the URI and the method on which the request is targeted ?
回答1:
Indeed this functionality is now commonly provided via http://ngmodules.org/modules/angular-digest-auth
来源:https://stackoverflow.com/questions/17531753/angularjs-and-digest-http-authentication