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);
This may not be the only problem, but it will need to be resolved before you get the authentication working.
I notice that you're using (the variable) password, whereas for Jira cloud, you need to be using an API token - see this post for further details.
Oh thats just a naming of the variable in my test setup to test this. I actually put a api token in there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.