简体   繁体   English

JMeter 脚本录制 - NTLM Windows 身份验证失败 - 401 错误

[英]JMeter Script Recording - NTLM Windows Authentication Fails - 401 Error

A JMeter script for an application needs to be recorded which has Windows Integrated authentication enabled and deployed on IIS.需要记录应用程序的 JMeter 脚本,该脚本启用并部署在 IIS 上的 Windows 集成身份验证。 I am working behind VPN and having a hard time getting the script ready(using JMeter 5.3, Java – 1.8), a Sign In authentication pop up comes up every time I start recording and I am unable to proceed further.我在 VPN 后面工作并且很难准备好脚本(使用 JMeter 5.3,Java – 1.8),每次我开始录制时都会弹出登录身份验证,我无法继续进行。

I tried various options like我尝试了各种选择,例如

  1. Setting up HTTP Authorization Manager to pass credentials as specified in the BlazeMeter guide but no luck.设置 HTTP 授权管理器以传递 BlazeMeter 指南中指定的凭据,但没有运气。
  2. I also tried changing HTTP Sampler Settings Type to Java as well as HTTPClient4 but none of them worked.我还尝试将 HTTP 采样器设置类型更改为 Java 以及 HTTPClient4,但它们都不起作用。
  3. I did enable the setting “httpclient4.auth.preemptive=true” but this also did not help.我确实启用了“httpclient4.auth.preemptive=true”设置,但这也没有帮助。
  4. I found this article which explains Jmeter recording error 401 which suggests to configure corporate_proxy_host and start the JMETER using command我发现这篇文章解释了Jmeter 记录错误 401建议配置corporate_proxy_host并使用命令启动JMETER

"jmeter -H your_corporate_proxy_host -P your_corporate_proxy_port -u username -a password" “jmeter -H your_corporate_proxy_host -P your_corporate_proxy_port -u 用户名 -a 密码”

However, when I tried to identify the VPN IP/Hostname in ControlPanel --> Internet Options, I did not find this option enabled.但是,当我尝试在 ControlPanel --> Internet Options 中识别 VPN IP/主机名时,我没有发现此选项已启用。 And we connect to VPN using tool.我们使用工具连接到 VPN。

Is there any other way to identify "corporate_proxy_host", Moreover, should this option be considered?有没有其他方法可以识别“corporate_proxy_host”,此外,是否应该考虑这个选项?

在此处输入图片说明

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

• Base URL: https:// [test site] • Username: [my user name] • 基本 URL:https:// [测试站点] • 用户名:[我的用户名]

• Password: [my password] • 密码:[我的密码]

• Domain: company domain (checked using systeminfo.exe) • 域:公司域(使用 systeminfo.exe 检查)

• Mechanism: BASIC • 机制:基本

However, I receive a 401 error (see Sampler Message below), Any suggestions?但是,我收到 401 错误(请参阅下面的采样器消息),有什么建议吗?

在此处输入图片说明 在此处输入图片说明

Wrong mechanism, for NTLM you need to use BASIC_DIGEST , the "Mechanism" is a dropdown:错误的机制,对于 NTLM,您需要使用BASIC_DIGEST ,“机制”是一个下拉列表:

在此处输入图片说明

also trying to recording NTLM login is not something you should really be doing, start your test with a HTTP Request sampler opening your application main page and well-behaved HTTP Authorization Manager will deal with the authentication/authorization sides of things.同样尝试记录 NTLM 登录并不是您真正应该做的事情,使用HTTP 请求采样器打开您的应用程序主页开始测试,行为良好的 HTTP 授权管理器将处理身份验证/授权方面的事情。

More information: Windows Authentication with Apache JMeter更多信息: Windows 身份验证与 Apache JMeter

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

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