How can I check if I am logged in after calling loginservice?
I get back a 200 but that seem not to mean you are logged in.
I get back a JSESSIONID but that does not seem to mean you are logged in.
How can I check if I am logged in after calling loginservice?
I get back a 200 but that seem not to mean you are logged in.
I get back a JSESSIONID but that does not seem to mean you are logged in.
You should get a 200 response and a JSESSIONID cookie. Here is an example using the Advanced Rest Client app in Chrome:
url: http://localhost:8080/bonita/loginservice
type: post
payload: username=walter.bates&password=bpm&redirect=false
Status returned: 200 OK
Generated by Advanced Rest Client - Chrome:
Request Headers:
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
Content-Type: application/x-www-form-urlencoded
Accept: /
Accept-Encoding: gzip,deflate
Accept-Language: en-US,en;q=0.8
Response Headers
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=80576E0F48F220301EDBD926A1AD1AAF; Path=/bonita; HttpOnly
Content-Length: 0
Date: Mon, 13 Oct 2014 17:33:03 GMT
The Set-Cookie header in the response is important because that is what you would use to make subsequent calls:
Here is a get human task call as an example:
url: http://localhost:8080/bonita/API/bpm/humanTask?p=0&c=10&f=state=ready
type: get
headers: Cookie: JSESSIONID=80576E0F48F220301EDBD926A1AD1AAF; Path=/bonita; HttpOnly
Generated by Advanced Rest Client - Chrome:
Status: 200 OK
Request Headers:
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Accept: /
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: JSESSIONID=80576E0F48F220301EDBD926A1AD1AAF; BOS_Locale=en
Response Headers:
Server: Apache-Coyote/1.1
Pragma: No-cache
Cache-Control: no-cache,no-store,no-transform,max-age=0
Expires: 12 Oct 2014 17:37:15 GMT
Content-Range: 0-10/0
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 13 Oct 2014 17:37:15 GMT
I hope this is helpful.