0
votes

I am performing load testing of HMAC API, I get an error message "unauthorized". The API requests in POSTMAN uses HMAC authentication and generates a code. I tried converting into jmx format from json via Loadimpact. The converted file doesn't hold the HMAC code. In Jmeter, file doesn't load the HMAC code.

Can anyone advice what alternative solutions are available? Does it really work with bean shell pre/post procedures.

1

1 Answers

0
votes

Postman per se isn't capable of performing HMAC encryption of the request, my expectation is that you're using some form of a pre-request script

This logic cannot be recorded and replayed, JMeter equivalent would be JSR223 PreProcessor

Request headers and body can be obtained/modified using prev shorthand for HTTPSamplerProxy class instance, see JavaDoc for all available functions and Top 8 JMeter Java Classes You Should Be Using with Groovy for more information on this and other JMeter API shortcuts available for the JSR223 Test Elements

Given that JMeter comes with Commons Codec you can easily use HmacUtils class to generate whatever you need