Page 2 of 3

YouTrack rest API

Posted: Fri Dec 21, 2012 3:44 pm
by Jon Crump

Thanks, I added and I'm still trying to get this to work.

I'm trying to get the cookie value with this js, but it appears to not work.

alert(jqXHR.getResponseHeader('Set-Cookie'));

Do you know how I can retrieve the value?


YouTrack rest API

Posted: Mon Dec 24, 2012 1:59 pm
by Maryna Brodina

Hello! We'll try to figure out and I update


YouTrack rest API

Posted: Mon Dec 24, 2012 3:39 pm
by Maryna Brodina

It seems it's not possible because of security browser restrictions.

You get cookie from another domain. You can set or send them automatically when you set withCredentials: true, but you can't read cookie.


YouTrack rest API

Posted: Thu Jan 03, 2013 5:28 pm
by Jon Crump

I have CORS enabled and can see the cookie in the browser. This is part of the Response headers:

Access-Control-Allow-Credentials:true
Access-Control-Allow-Origin:http://project.tiggzi.com

To be clear is it not possible to use a session cookie to authenticate a REST API with Tiggzi?


YouTrack rest API

Posted: Thu Jan 03, 2013 6:22 pm
by maxkatz

Tiggzi is an app builder, the app runs in the browser. So you can use session cookies to authenticate a REST API. You can build anything the browser supports.


YouTrack rest API

Posted: Thu Jan 03, 2013 6:25 pm
by Jon Crump

So please can you share the code how to do it, Marina said it's not possible, see her comments in the thread above.


YouTrack rest API

Posted: Thu Jan 03, 2013 7:44 pm
by maxkatz

Not being able to read cookies from another domain -- is a browser restriction, not Tiggzi's. You would face the same problem if you didn't use Tiggzi.


YouTrack rest API

Posted: Thu Jan 03, 2013 7:48 pm
by Jon Crump

This is confusing you just said above you can do it and now you can't because it's a problem (Which is why I'm posting in the first place). I have CORS enabled and see the cookie in the browser when I use the Chrome inspector.


YouTrack rest API

Posted: Thu Jan 03, 2013 7:57 pm
by maxkatz

You can do anything the browser supports, however reading cookies from another domain is not supported by the browser.


YouTrack rest API

Posted: Thu Jan 03, 2013 8:01 pm
by Jon Crump

This is just wasting time. How could I see the cookie in the browser if the browser doesn't support it?

And your previous comment...
Max Katz (Official Rep) 2 hours ago
Tiggzi is an app builder, the app runs in the browser. So you can use session cookies to authenticate a REST API. You can build anything the browser supports.