问题描述
我正在尝试以角度实现摘要身份验证算法.但是,由于缺乏对角度请求的了解,这使我无法感知该目标.我的方法是通过
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)
显然,
没有任何有关即将到来的请求的知识.由于我完全不了解请求URI(尤其是方法,例如PUT,GET等),因此无法计算出正确的摘要哈希.
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.
是否有人知道transformRequest函数如何获取URI和请求所针对的方法?
推荐答案
实际上,现在通常通过 http://ngmodules.org/modules/angular-digest-auth
Indeed this functionality is now commonly provided via http://ngmodules.org/modules/angular-digest-auth
这篇关于AngularJS和摘要HTTP身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!