0
votes

Im using Jmeter to write some load tests on an API secured by oAuth. I want to be able to reuse the header manager once the bearer token has been produced from the access token call.

However when I try to move the header manager out side of the http request the call is no longer authorised. I think its because it can no longer get the bearer token.

enter image description here For Post Request, when i put the header manager outside it no longer works, it only works when I put it under the request as I have done for User get request, Delete request and Put request.

How do I make the header manager reusable and therefore only manage one header manager?

Thank you.

{"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}
1

1 Answers

0
votes

My expectation is that this is due to clash with the HTTP Authorization Manager

  1. Both are Configuration Elements and both obey JMeter Scoping rules
  2. When you move HTTP Header Manager outside the HTTP Request sampler it might be the case that Authorization Header comes from the HTTP Authorization Manager

You can check which exact header value is being sent using Request -> Request Headers tab of the View Results Tree listener

enter image description here


Given you manually create Authorization header for your request I believe if you disable or delete the HTTP Authorization Manager your test should start working as expected as you basically don't need it.