【问题标题】:JMeter NTLM authentication failingJMeter NTLM 身份验证失败
【发布时间】:2018-02-22 00:18:06
【问题描述】:

我对 JMeter 比较陌生,但我很难让 HTTP 采样器登陆安全网页。我认为它需要 NTLM 身份验证,因此我使用 HTTP 授权管理器来传递 BlazeMeter guide 中指定的凭据

我的授权管理器具有以下值:

  • 基本网址:https://[测试站点]
  • 用户名:[我的用户名]
  • 密码:[我的密码]
  • 域:与基本 URL 相同
  • 机制:BASIC_DIGEST

但是,我只收到 401 错误(请参阅下面的采样器消息)

Thread Name: Thread Group 1-1
Sample Start: 2018-02-21 15:55:18 PST
Load time: 26
Connect Time: 0
Latency: 26
Size in bytes: 1602
Sent bytes:229
Headers size in bytes: 309
Body size in bytes: 1293
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 401
Response message: 401

Response headers:
HTTP/1.1 401 401
Content-Type: text/html
Content-Language: en
Server: Microsoft-IIS/7.5
WWW-Authenticate: Negotiate
WWW-Authenticate: NTLM
WWW-Authenticate: Basic realm="BasicSecurityFilterProvider"
X-Powered-By: ASP.NET
Date: Wed, 21 Feb 2018 23:55:18 GMT
Connection: close
Content-Length: 1293


HTTPSampleResult fields:
ContentType: text/html
DataEncoding: iso-8859-1

我尝试了以下方法,但仍然收到 401 错误。有什么建议吗?

  • 将所有 HTTP 请求实现更改为 HTTPClient4
  • 在 user.properties 中设置 httpclient4.auth.preemptive=true
  • 启用使用 KeepAlive 选项

【问题讨论】:

    标签: jmeter ntlm


    【解决方案1】:

    根据Windows Authentication with Apache JMeter 指南,您应该将Domain 替换为不是您的基本URL,而是Windows 域名。根据参考指南:

    域:应该是“您在 Windows 安全弹出窗口中看到的内容”,因为这是真正的浏览器所做的。如果您不确定,可以在该字段中输入完全限定的域名。

    您还可以通过运行systeminfo 命令来找出您的域名,例如:

    systeminfo | find "Domain"
    

    【讨论】:

      猜你喜欢
      • 2011-05-19
      • 1970-01-01
      • 1970-01-01
      • 2015-01-10
      • 2013-01-02
      • 1970-01-01
      • 2018-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多