I was trying to access JIRA login apis from the C# code and Unauthorized error is displayed.
The code snippet is given below:
var mergedCredentials = string.Format("{0}:{1}", "<username>", "<password>");
var byteCredentials = Encoding.UTF8.GetBytes(mergedCredentials);
var encodedCredentials = Convert.ToBase64String(byteCredentials);
using (WebClient webClient = new WebClient())
{
webClient.Headers.Set("Authorization", "Basic " + encodedCredentials);
return webClient.DownloadString("https://<jira_url>/rest/auth/1/session");
}
Can you please help me to resolve the issue? The username and password are the ones which we use to login to our jira url. Even substituted the Profile name as the user name and the Jira token as the password. Still getting the Unauthorized error.
Hi,
Is there any solution for this? Any help is appreciated.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.