首页 文章

JMeter NTLM身份验证失败

提问于
浏览
0

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

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

  • 基本网址:https:// [测试网站]

  • 用户名:[我的用户名]

  • 密码:[我的密码]

  • 域:与基本URL相同

  • 机制:BASIC_DIGEST

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

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选项

1 回答

  • 0

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

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

    JMeter Windows Domain Name

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

    systeminfo | find "Domain"
    

相关问题