Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Log out service

Hi,
I have a database log out service set up to log off the user. The session token mapping is via custom javascript. I am getting a 401 unauthorized error. What is the correct approach.

Regards,
Joe

var LS = localStorage.getItem('_sessionToken');
return LS;

Image

Request URL:https://api.tiggzi.com/rest/1/db/logout
Request Method:GET
Status Code:401 Unauthorized
Request Headersview source
Accept:application/json, text/javascript, /; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:api.tiggzi.com
Origin:http://project.tiggzi.com
Referer:http://project.tiggzi.com/preview/7cf...
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22
X-Tiggzi-Database-Id:50b33f33e4b0747d4efdf42d
X-Tiggzi-Session-Token:
Response Headersview source
Access-Control-Allow-Origin:http://project.tiggzi.com
Connection:keep-alive
Content-Type:application/json
Date:Thu, 21 Mar 2013 12:06:14 GMT
Server:nginx
Set-Cookie:JSESSIONID=8uC+CQXeE1OazIqiyIJrkg87.undefined; Path=/; Secure
Transfer-Encoding:chunked

Google Chrome

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Log out service

Hi Joe,

Request parameter "X-Tiggzi-Session-Token" that is sent to server is empty (there should be text after":", but there is "X-Tiggzi-Session-Token:" now).

Why do you use JavaScript to use localStorage variable as a Request parameter? You can use Mapping.

Are you sure there is a correct value in localStorage variable _sessionToken (you get it using Login rest service)?

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Log out service

Hi Kataya, I am using the Login rest service but I am unable to see the localStorage variable _sessionToken. Perhaps I misunderstood the process is the varable automatically set after a successful login using the Login rest service or do I have to write the session token from the success event of the Loging rest service.

Joe Bohen
Posts: 0
Joined: Wed Nov 28, 2012 11:28 am

Log out service

Hi Katya, Got it sorted, I was having a moment! Thanks for your help.

Return to “Issues”