在 AIR 中禁用 HTTP 摘要身份验证窗口
我正在尝试使用 AIR 进行摘要式身份验证,除了出现要求输入用户名和密码的恼人的身份验证窗口(默认系统窗口)之外,它可以正常工作。
如果我单击取消,一切都会正常工作,直到下一个身份验证请求等等。但只有一直点击“取消”才有效。
如果我单击“确定”,窗口会再次弹出(这是一种逻辑,不是吗)。
请求如下所示:
public function startT0Registration():void
{
var req : URLRequest = new URLRequest(url);
var loader : URLLoader = new URLLoader();
req.method = URLRequestMethod.PUT;
loader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, handleRegistration);
try {
loader.load(req);
} catch (error:Error) {
trace("startRegistration: Unable to load requested document.");
}
}
我遇到的问题是当我尝试禁用窗口时:
req.authenticate = false;
我没有从服务器获得所需的 HTTP 401 错误,并带有以下 WWW-Athenticate< /strong> 标头信息:
Digestrealm="TestRealm", qop="auth", nonce="32L HEX HASH", opaque="32L HEX HASH"
而不是收到 401 错误,我收到 HTTP 407 错误,但没有必要的 WWW-Athenticate 标头信息。
由于我必须进行摘要身份验证,因此我需要该标头来响应服务器。
必须有一个解决方案。
I'm trying to da a digest authentication with AIR and it works except for the annoying authentication window (default system window) that comes up asking for username and password.
If I click cancel everything works as it should till the next request of the authentication and so on. But it works only with clicking cancel all the time.
If I click OK the window pops up again (kind of logic, isn't it).
the request looks like this:
public function startT0Registration():void
{
var req : URLRequest = new URLRequest(url);
var loader : URLLoader = new URLLoader();
req.method = URLRequestMethod.PUT;
loader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, handleRegistration);
try {
loader.load(req);
} catch (error:Error) {
trace("startRegistration: Unable to load requested document.");
}
}
The problem I have is when I try to disable the window with:
req.authenticate = false;
I'm not getting the needed HTTP 401 Error from the server with the following WWW-Athenticate header information:
Digest realm="TestRealm", qop="auth", nonce="32L HEX HASH", opaque="32L HEX HASH"
Instead of getting the 401 Error, I'm getting a HTTP 407 Error without the neccessary WWW-Athenticate header information.
As I have to do a digest authentication I need that header to respond to the server.
There must be a solution for that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的应用程序和后端之间的代理服务器似乎有问题。 -->问题通过a解决了
无代理连接
和
req.authenticate = false;
seems to be a problem with a proxy server between my application and the backend. --> Problem solved thru a
proxy free connection
and
req.authenticate = false;