JMeter NTLM 身份验证失败
JMeter NTLM authentication failing
我对 JMeter 比较陌生,但我很难让 HTTP 采样器登陆安全网页。我认为它需要 NTLM 身份验证,所以我使用 HTTP 授权管理器来传递 BlazeMeter guide
中指定的凭据
我的授权管理器具有以下值:
- 基础URL: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 选项
根据 Windows Authentication with Apache JMeter 指南,您应该将 Domain
替换为不是您的基础 URL 而是 Windows 域名。根据参考指南:
Domain: should be “what you see in Windows Security pop-up” as this is what real browsers do. If you are uncertain you can type a fully qualified domain name into that field.
您还可以通过 运行 systeminfo 命令找出您的域名,例如:
systeminfo | find "Domain"
我对 JMeter 比较陌生,但我很难让 HTTP 采样器登陆安全网页。我认为它需要 NTLM 身份验证,所以我使用 HTTP 授权管理器来传递 BlazeMeter guide
中指定的凭据我的授权管理器具有以下值:
- 基础URL: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 选项
根据 Windows Authentication with Apache JMeter 指南,您应该将 Domain
替换为不是您的基础 URL 而是 Windows 域名。根据参考指南:
Domain: should be “what you see in Windows Security pop-up” as this is what real browsers do. If you are uncertain you can type a fully qualified domain name into that field.
您还可以通过 运行 systeminfo 命令找出您的域名,例如:
systeminfo | find "Domain"