0
votes

I work in a company where we use a proxy to access any browser website.

We would like to start API testing with JMeter, but have a problem.

Whenever I try to add an API call to petstore.swagger.io/v2/pet/10, for example, and put in the proxy details in the "Advanced" section of the HTTP request + adding an HTTP authorization manager with Username + Password, it still gives me a "407 Authenticationrequired" error back.

Request headers:

JMeter - request headers

Response headers:

JMeter - response headers

In the information I have also it's that the proxy is "Ruleset Name: Authentication with Kerberos and NTLM Fallback".

This is quite a problem if I'd like to test internal APIs with any authorization on it.

1
"we use a proxy to access any browser website ... Authentication with Kerberos " >> this kind of proxy is meant for browsers (i.e. for humans), not for services. And especially not for Java stuff. Can you get clearance to install a proxyfier utility on your desktop, to bridge the gap between JDumpster and your proxy? I suspect Microsoft extensions in the mix...Samson Scharfrichter
Hi, Company doesn't allow my to bypass the proxy unfortunately. As a simple Automation tester i don't have those rights.. I have seen i could authenticate with kerberos with Jmeter would that be a solution you think? I've been trying to authenticate with NTLM. But i always get a 407 back even with User/Pass + DomainAymeric Wilmotte
A "proxyfier" does not bypass the proxy -- it handles the proxy negotiation for apps that cannot do that natively. Check Wikipedia...Samson Scharfrichter
I have installed proxyfier and set up the proxy + proxy rule. Even with that i still get the same 407 error back. (I realised my error after research, sorry my bad.) But even with it, It still doesn't work. Any tips?Aymeric Wilmotte

1 Answers

0
votes

HTTP Status code 407 means that proxy authentication required, it seems that you're using a corporate proxy to access the application under test and this proxy requires credentials.

You have 2 options of passing the proxy credentials to JMeter:

  1. Command-line arguments like:

    jmeter -H my.proxy.server -P 8000 -u username -a password
    
  2. JMeter System properties (you can put these lines to system.properties file

    http.proxyUser=username
    http.proxyPass=password