I first authenticate against an OpenMRS instance using:
curl -u <username>:<password> https://<server name>/ws/rest/v1/session
which returns this value in the response:
I then try to use this sessionId token for a subsequent call:
curl --header 'Set-Cookie: JSESSIONID=D7C5E8BED7EDA2381E69126A40B3B22C' https://<server name>/ws/rest/v1/person?q=jim
As per the documentation this cookie should be enough to authenticate the request, but I get a “User is not logged in” message.
Any ideas why?