Hi,
I need to invoke a URL, using both Authorization Bearer token and X-XSRF-TOKEN.
Scenario in detail:
.yml file
scenarios:
iam:
variables:
userToken: no token
xsrfToken: no token
requests:
- url: https://URL1
method: POST
label: iam
body:
headers:
extract-jsonpath:
userToken: $.access_token
- url: https://URL2
method: GET
label: token
headers:
Authorization: Bearer ${__base64Encode(${userToken})}
extract-jsonpath:
xsrfToken: $.xsrf-token
- url: https://URL3
method: POST
label: home
headers:
Authorization: Bearer ${__base64Encode(${userToken})}
X-XSRF-TOKEN: {xsrfToken}
body-file: bodyFile.txt
First two URL’s are working fine, but the third one fails with exception: “HTTP Status 403 – Forbidden” (error message from in error.jtl file).
The same URL’s are working fine in postman requests.
Required executor is jmeter.
I am not sure if I am passing the token correctly. Request your support in resolving this exception.
X-XSRF-TOKEN:
xsrfToken: ${xsrfToken}
Output in JMeter