AngularJS and Digest HTTP Authentication

我与影子孤独终老i 提交于 2019-12-10 15:46:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!