Search code examples
jmeterntlm

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. I think it requires NTLM authentication, so I used the HTTP Authorization Manager to pass credentials as specified in the BlazeMeter guide

My Authorization Manager has the following values:

  • Base URL: https:// [test site]
  • Username: [my user name]
  • Password: [my password]
  • Domain: Same as base URL
  • Mechanism: BASIC_DIGEST

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?

  • Changing all HTTP Request implementations to HTTPClient4
  • Setting httpclient4.auth.preemptive=true in the user.properties
  • Enable Use KeepAlive option

Solution

  • As per Windows Authentication with Apache JMeter 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.

    JMeter Windows Domain Name

    You can also figure out your domain name by running systeminfo command like:

    systeminfo | find "Domain"