407 authenticationrequired in JMeter

942 Views Asked by At

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

There are 1 best solutions below

3
Dmitri T On

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