Iam working on a integration between Jira and Uptrends for our clients.
Now iam trying to authenticate to Jira using basic authentication from C#. However it seems that if I use the following code to get basic authentication working it responds with a 404:
CredentialCache credentialCache = new CredentialCache();
credentialCache.Add(requestUri, "Basic", new NetworkCredential(username, password));
This seems to be caused by the fact that the Jira server does not send a 401 but a 404. Was this done on purpose? Is the only solution is to force the authorization headers to be send on the first request like so?
string encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + password));
httpWebRequest.Headers.Add("Authorization", "Basic " + encoded);