Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

YouTrack rest API

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?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

YouTrack rest API

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

YouTrack rest API

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.

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

YouTrack rest API

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?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

YouTrack rest API

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.

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

YouTrack rest API

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

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

YouTrack rest API

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.

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

YouTrack rest API

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

YouTrack rest API

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

Jon Crump
Posts: 0
Joined: Tue Dec 11, 2012 8:34 pm

YouTrack rest API

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.

Return to “Issues”