I have the following Test Plan which consists of a /auth/login call and then another /user/getmydata call which requires the Authorization cookie set by the login call
The output of the /auth/login call shows that the Authorization cookie is returned
Response headers:
HTTP/1.1 200
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/json;charset=UTF-8
Date: Wed, 05 Apr 2017 18:53:49 GMT
Expires: 0
Pragma: no-cache
Server: nginx/1.10.1
Set-Cookie: Authorization=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1OGU1MWU5Y2EwOWQyNDQxZTZiOTUyNDciLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJ1c2VyU2VlZCI6IjEwN250aGUiLCJleHAiOjE0OTI2MjgwMjl9.CjsKvpkdiuWkhJcsfURV6DuKbp4jjqLGPZR26GizTdCu7XstRmS0WmLqwVRswUvfKcAI8bNjU5MqW6K2Z2PVfg
X-Application-Context: application:stg1-us-east-1:8080
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
Content-Length: 646
Connection: keep-alive
However the next /user/getmydata call does not show the cookie to be passed back in the request and the call therefore fails
GET https://somedomain.com/user/getmydata
GET data:
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Content-Length: 0
Host: somedomain.com
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
The debug logs show:
2017/04/05 15:44:42 DEBUG - jmeter.protocol.http.control.HC4CookieHandler: Received Cookie: Authorization=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1OGU1MWU5Y2EwOWQyNDQxZTZiOTUyNDciLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJ1c2VyU2VlZCI6IjEwN250aGUiLCJleHAiOjE0OTI2MzEwODJ9.vCf2Pl2BddEBDmCIuHzcSuE-cDL5p3AXkQHYjD-XRuQZ-7xOh0wrSoAhKiWsg18cYyY-y2RqcMQLQ73z4C1W-Q From: https://api-stg1.somedomain.com/auth/login
2017/04/05 15:44:42 DEBUG - jmeter.protocol.http.control.CookieManager: Add cookie to store api-stg1.somedomain.com TRUE /auth FALSE 0 Authorization eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI1OGU1MWU5Y2EwOWQyNDQxZTZiOTUyNDciLCJ0b2tlblR5cGUiOiJBQ0NFU1MiLCJ1c2VyU2VlZCI6IjEwN250aGUiLCJleHAiOjE0OTI2MzEwODJ9.vCf2Pl2BddEBDmCIuHzcSuE-cDL5p3AXkQHYjD-XRuQZ-7xOh0wrSoAhKiWsg18cYyY-y2RqcMQLQ73z4C1W-Q
2017/04/05 15:44:42 DEBUG - jmeter.protocol.http.control.HC4CookieHandler: Found 0 cookies for https://api-stg1.somedomain.com/user/getmydata
What am I doing wrong?