使用 WCAT 和 NTLM 时出现意外的 HTTP 状态代码

发布于 2024-11-06 08:58:41 字数 476 浏览 4 评论 0原文

有谁知道在测试使用 NTLM 身份验证的 Web 应用程序时如何避免 WCAT 记录意外的“401 未经授权”HTTP 状态代码?我用于请求的代码示例如下:

    request
    {
    url = "http://server";
    authentication = NTLM;
    username = "user";
    password = "xxxx";
    statuscode = 200;
    }

为了澄清,该脚本工作正常并且确实能够检索内容,但是当针对 IIS7 服务器运行时,NTLM 协商(我相信)意味着记录了初始 401 代码以及最终的 200 代码。

这意味着测试后报告显示的 401 代码数量与 200 代码数量相同,不幸的是 401 被记录为意外代码/错误。

我意识到这与之前提出的问题类似,但这个问题专门询问是否有一种方法可以避免意外的状态代码。

谢谢!

Does anyone know how to avoid WCAT recording unexpected "401 Unauthorized" HTTP Status codes when testing a web application that uses NTLM authentication? An example of the code I am using for a request is below:

    request
    {
    url = "http://server";
    authentication = NTLM;
    username = "user";
    password = "xxxx";
    statuscode = 200;
    }

To clarify, this script works fine and does manage to retrieve the content but when ran against an IIS7 server the NTLM negotiation (I believe) means that the initial 401 code is recorded as well as the final 200 code.

This means that after a test the report shows the same amount of 401 codes as 200 codes, and unfortunately the 401s are recorded as unexpected codes/errors.

I realise this is a similar question to one asked earlier, but this one is specifically asking if there is a way to avoid the unexpected status codes.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹿港小镇 2024-11-13 08:58:41

您需要的(我认为)是一个 transaction { ... } ,其中包含许多 request { ... } 元素,其中一些需要 401 状态代码:

transaction
{
    id = "home";
    weight = 1000;
    request
    {
        url = "/";
        statuscode = 401;
        redirect = true;
        cookies = true;
    }
    request
    {
        url = "/";
        statuscode = 401;
        authentication = NTLM;
        username = "domain\\username";
        password = "password";
        redirect = true;
        cookies = true;
    }
    request
    {
        url = "/";
        authentication = NTLM;
        username = "domain\\username";
        password = "password";
        statuscode = 200;
        redirect = true;
        cookies = true;
    }
}

What you need (I think) is a transaction { ... } with a number of request { ... } elements inside, some of which expect a 401 statuscode:

transaction
{
    id = "home";
    weight = 1000;
    request
    {
        url = "/";
        statuscode = 401;
        redirect = true;
        cookies = true;
    }
    request
    {
        url = "/";
        statuscode = 401;
        authentication = NTLM;
        username = "domain\\username";
        password = "password";
        redirect = true;
        cookies = true;
    }
    request
    {
        url = "/";
        authentication = NTLM;
        username = "domain\\username";
        password = "password";
        statuscode = 200;
        redirect = true;
        cookies = true;
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文