首页 > 解决方案 > JMeter 自定义身份验证

问题描述

我们目前采用非标准身份验证方法,并在我们的请求授权标头中提供该方法。

因此,我们不得不使用 JMeter 等软件。我已经进行了一些挖掘,但我们在这方面没有经验。

推进这一进程的最佳方式是什么?

标签: authenticationjmeter

解决方案


There are several workarounds:

  1. You can use a real browser driven by the WebDriver Sampler, once you have the authentication context you can extract it and add the header to JMeter's HTTP Request samplers using HTTP Header Manager
  2. The custom client code can be implemented in JMeter in the appropriate JSR223 Test Element, you can even re-use JavaScript code but be aware that you won't be able to use Navigator object or anything else connected with the browser.
  3. If you don't to load-test the authentication routine itself and want to focus solely on the application you can hard-code a test header which will be accepted by the application and use the aforementioned HTTP Header Manager to supply this token

推荐阅读