I’m making a small .Net application which needs to be able to download build artifacts from the CircleCI API. Everything worked fine locally but after deploying to a Citrix machine the authentication doesn’t seem to be working. I’ve checked and everything appears to be the same in both scenarios.
See below for an example of the code used.
public T Read()
{
using (var wc = new WebClient())
{
wc.Headers.Add(HttpRequestHeader.ContentType, "application/json");
wc.Headers.Add(HttpRequestHeader.Accept, "application/json");
wc.Headers.Add("circle-token", "XXXXXXXXXXXXXXXXXXXXXXXXXXX");
var json = wc.DownloadString("https://circleci.com/api/v2/me");
return JsonConvert.DeserializeObject<T>(json, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
}
}
When pasting the following url directly into Chrome on the Citrix box I get the response “You must log in first.”
https://circleci.com/api/v2/me?Circle-Token=XXXXXXXXXXXXXXXXXXXXXXX
As far as I’m aware the only authentication needed is the token? I’ve definitely created a personal token (not a project one) and all of the calls I’ve been making from my local machine have worked fine with just that. Is there something extra that I’m missing?
Thanks in advance.