Reputation: 1
passing authorization token to subsequent request using JSON extractor in jmeter. I have 2 requests
I have generated token and extracted using JSON extractor (name of the variable is TOKEN) and Using Debug sampler i verified that bearer token is extracted. after that i added 'HTTP Header Manager' to the next request. and added Authorization there like
Name = Authorization and Value = ${TOKEN}.
Getting 'Unauthorized access running the script while running the script for second (Get Policy) request.
Upvotes: 0
Views: 940
Reputation: 168002
As per RFC 6750
When sending the access token in the "Authorization" request header field defined by HTTP/1.1 [RFC2617], the client uses the "Bearer" authentication scheme to transmit the access token.
For example:
GET /resource HTTP/1.1 Host: server.example.com Authorization: Bearer mF_9.B5f-4.1JqM
So correct configuration of the HTTP Header Manager would be:
Upvotes: 0
Reputation: 1966
For Bearer authorization, your header value must be Bearer YOUR_TOKEN
, you missed Bearer keyword in value and HTTP Header Manager can not understand your authorization method.
Name = Authorization and Value = Bearer ${TOKEN}
I hope this can help you
Upvotes: 0