Thanks. This was huge for me as I was trying to write some .Net code and I kept getting '401' error messages when trying to do a GET on "session/1/session" using my cookie session. I didn't have access to any of the README notes - just the API documentation online. Initially testing on a VM things worked fine, but when switching to our production Isilon, that's when I started getting the authorization errors. I was always wondering when creating the cookie for the very first time what the 'isicsrf' value was for. It wasn't mentioned in the API documentation so I just ignored it.
For any others that may need a start, here is what I used to get session info (GET "session/1/session") about my current cookie.
CookieID - the value of 'isisessid=xxxxxx' from the cookie
CookieCSRF - the value of 'yyyyyy' from the cookie with the 'isicsrf=' removed
Tim681
1 Message
2
June 6th, 2018 10:00
Thanks. This was huge for me as I was trying to write some .Net code and I kept getting '401' error messages when trying to do a GET on "session/1/session" using my cookie session. I didn't have access to any of the README notes - just the API documentation online. Initially testing on a VM things worked fine, but when switching to our production Isilon, that's when I started getting the authorization errors. I was always wondering when creating the cookie for the very first time what the 'isicsrf' value was for. It wasn't mentioned in the API documentation so I just ignored it.
For any others that may need a start, here is what I used to get session info (GET "session/1/session") about my current cookie.
CookieID - the value of 'isisessid=xxxxxx' from the cookie
CookieCSRF - the value of 'yyyyyy' from the cookie with the 'isicsrf=' removed
isilonUrl - the address of your isilon - 'https://1.1.1.1:8080'
using (var client = new HttpClient(new HttpClientHandler { UseCookies = false }))
{
client.DefaultRequestHeaders.Add("Cookie", CookieID);
client.DefaultRequestHeaders.Add("X-CSRF-Token", CookieCSRF);
client.DefaultRequestHeaders.Add("Referer", isilonUrl);
var response = await client.GetAsync(
isilonUrl + "/session/1/session");
response.EnsureSuccessStatusCode();
//get the session information
var body = await response.Content.ReadAsStringAsync();
}
apalomet
1 Message
0
May 25th, 2023 13:00
This helped me a lot. Thanks.
For the ones using curl, to get the Cookie is like this one below:
From your response you get the cookie data to be used for consequent curls. Like this below for instance: (values are examples, not my actual ones).