I'm trying to Functional test a few APIs that need to be authenticated (OAuth 2.0) and simulate this in JMeter.
I'm trying to authenticate the OAuth service for Azure cloud. Has anyone out there been able to successfully create JMeter HTTP requests to authenticate against OAuth 2.0?
Basically you need to add HTTP Header Manager to send Authorization
header with the value of Bearer ${ACCESS_TOKEN}
in order to make authenticated OAuth API calls.
Access token can be obtained in 2 major ways:
Implement OAuth2 flow in your test, i.e. :
In regards to implementing option 2 - it will require 3 separate JMeter samplers (or alternatively you can get the access token programmatically via JSR223 Sampler)
References: