I have this code below, i need to login but Jira documantation so bad that i cant figured out, how can i login to jira ? They say basic auth is depreced but all examples are like this. How can i login ?
string apiUrl = @"https://MYDOMAIN.atlassian.net/rest/api/3/issue/MYPROJECTNAME";
using (var httpClient = new HttpClient())
{
using (var request = new HttpRequestMessage(new HttpMethod("GET"), apiUrl))
{
var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes("MYEMAIL@gmail.com:1xzyNAGgksdfgP3155"));
request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");
var response = await httpClient.SendAsync(request);
}
}
Hi @hania noor ,
welcome to the Atlassian community!
Please, use the following link to put in place a basic authentication https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/
The correct URL should be https://your-domain.atlassian.net/rest/api/2/issue/createmeta
Hope this helps,
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.