
Question:
I'm relatively new to JMeter, but I am having a hard time getting an HTTP Sampler to land on a secured webpage. I think it requires NTLM authentication, so I used the HTTP Authorization Manager to pass credentials as specified in the <a href="https://www.blazemeter.com/blog/windows-authentication-apache-jmeter" rel="nofollow">BlazeMeter guide</a>
My Authorization Manager has the following values:
<ul><li>Base URL: https:// [test site] </li> <li>Username: [my user name] </li> <li>Password: [my password] </li> <li>Domain: Same as base URL </li> <li>Mechanism: BASIC_DIGEST</li> </ul>However, I just get a 401 error (see Sampler Message below)
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. Any suggestions?
<ul><li>Changing all HTTP Request implementations to HTTPClient4</li> <li>Setting httpclient4.auth.preemptive=true in the user.properties</li> <li>Enable Use KeepAlive option </li> </ul>Answer1:As per <a href="https://www.blazemeter.com/blog/windows-authentication-apache-jmeter" rel="nofollow">Windows Authentication with Apache JMeter</a> guide you should replace Domain
to not to be your base URL but rather Windows Domain name. As per the referenced guide:
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.
</blockquote><a href="https://i.stack.imgur.com/2k2pG.png" rel="nofollow"><img alt="JMeter Windows Domain Name" class="b-lazy" data-src="https://i.stack.imgur.com/2k2pG.png" data-original="https://i.stack.imgur.com/2k2pG.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>
You can also figure out your domain name by running <a href="https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb491007(v=technet.10)" rel="nofollow">systeminfo</a> command like:
systeminfo | find "Domain"