Friday, August 23, 2013

Work with NTLM authentication based application in JMeter

While working on performance testing project of SharePoint application, I faced some issues in recording and replaying the JMeter script.
The application had an implementation of NTLM authentication where windows credentials are used to authenticate the user. The web application does not have standard login page ( basic authentication) where we supply the username and password to log into the application instead a window pops up in the browser when we launch the application.
Since window pop up is a client side activity, the JMeter does not capture the request.

To record the flow in JMeter, follow below steps:
  1. Enable the proxy server in connection - proxy setting of your browser and enter Address : 127.0.0.1 and Port : 8080
  2. In HTTP Proxy server mention 8080 as port number.
  3. Select Type as Java in HTTP Sampler Settings of HTTP Proxy Server. If Type as HttpClient4 is selected, the credentials pop up of browser does not disappear, however the page requested gets recorded. But we will not be able to record the next step in this case.
  4. Record the steps in transaction controllers of JMeter.
  5. Once the recording gets complete. Change the Implementation type of each request from Java to HttpClient4.
  6. Add HTTP Authorization Manager. Provide values in following necessary fields:
    1. Base URL (ex: https://...)
    2. Username (ex: user1)
    3. Password (ex: pwd1)
    4. Domain (ex: blogger.com)


2 comments:

  1. Thanks for great post. There is another one Windows Authentication with Apache JMeter which gives more detailed background explanation and also covers Kerberos handling.

    ReplyDelete
  2. I configed as your guide and can record trafic with Ntlm in a Pc, but i try to copy jmeter and try in another pc, authen popup is always block next steps in app and i can not pass it, although i set java for http sample. Anybody have any experience about this problem with Ntlm?

    ReplyDelete