简体   繁体   English

JMeter NTLM身份验证失败

[英]JMeter NTLM authentication failing

I'm relatively new to JMeter, but I am having a hard time getting an HTTP Sampler to land on a secured webpage. 我不是JMeter的新手,但是我很难让HTTP Sampler登陆安全的网页。 I think it requires NTLM authentication, so I used the HTTP Authorization Manager to pass credentials as specified in the BlazeMeter guide 我认为它需要NTLM身份验证,因此我使用了HTTP授权管理器来传递BlazeMeter指南中指定的凭据

My Authorization Manager has the following values: 我的授权管理器具有以下值:

  • Base URL: https:// [test site] 基本网址:https:// [测试站点]
  • Username: [my user name] 用户名:[我的用户名]
  • Password: [my password] 密码:[我的密码]
  • Domain: Same as base URL 域:与基本URL相同
  • Mechanism: BASIC_DIGEST 机制:BASIC_DIGEST

However, I just get a 401 error (see Sampler Message below) 但是,我只收到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

I tried the following, but still get a 401 error. 我尝试了以下操作,但仍然出现401错误。 Any suggestions? 有什么建议么?

  • Changing all HTTP Request implementations to HTTPClient4 将所有HTTP请求实现更改为HTTPClient4
  • Setting httpclient4.auth.preemptive=true in the user.properties 在user.properties中设置httpclient4.auth.preemptive = true
  • Enable Use KeepAlive option 启用使用KeepAlive选项

As per Windows Authentication with Apache JMeter guide you should replace Domain to not to be your base URL but rather Windows Domain name. 根据使用Apache JMeter的Windows身份验证指南,您应该将Domain替换为您的基本URL而不是Windows域名。 As per the referenced guide: 根据参考指南:

Domain: should be “what you see in Windows Security pop-up” as this is what real browsers do. 域:应该是“您在Windows安全性弹出窗口中看到的内容”,因为这是真实浏览器的作用。 If you are uncertain you can type a fully qualified domain name into that field. 如果不确定,可以在该字段中输入完全限定的域名。

JMeter Windows域名

You can also figure out your domain name by running systeminfo command like: 您还可以通过运行systeminfo命令来找出您的域名,例如:

systeminfo | find "Domain"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM