help me in creating authentication for JIRA REST API in node js with just username and password of jira atlassian account .
Hello @Natnael Tamrat ,
Welcome to the Atlassian Community!
Please notice that basic authentication with username and password has been deprecated long time ago in Cloud and that you now have to use Atlassian account email address and API token instead:
For the rest, all you have to do is to add an authorization header to your call built by following the instructions you can find in the "Supply basic auth headers" section of the Basic Auth for REST API documentation page for Jira Cloud:
Supply basic auth headers You can construct and send basic auth headers. To do this you perform the following steps: Generate an API token for Jira using your Atlassian Account. Build a string of the form useremail:api_token. BASE64 encode the string. Linux/Unix/MacOS: echo -n user@example.com:api_token_string | base64 Windows 7 and later: $Text = ‘user@example.com:api_token_string’ $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text) $EncodedText = [Convert]::ToBase64String($Bytes) $EncodedText Supply an Authorization header with content Basic followed by the encoded string. For example, the string fred:fred encodes to ZnJlZDpmcmVk in base64, so you would make the request as follows: curl -D- \ -X GET \ -H "Authorization: Basic ZnJlZDpmcmVk" \ -H "Content-Type: application/json" \ "https://your-domain.atlassian.net/rest/api/2/issue/QA-31"
You can construct and send basic auth headers. To do this you perform the following steps:
useremail:api_token
echo -n user@example.com:api_token_string | base64
$Text = ‘user@example.com:api_token_string’ $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text) $EncodedText = [Convert]::ToBase64String($Bytes) $EncodedText
Authorization
Basic
fred:fred
ZnJlZDpmcmVk
curl -D- \ -X GET \ -H "Authorization: Basic ZnJlZDpmcmVk" \ -H "Content-Type: application/json" \ "https://your-domain.atlassian.net/rest/api/2/issue/QA-31"
Finally, for the future, please notice that this is not the best place to get help on development related questions. The right resources are listed in https://developer.atlassian.com/resources.
Specifically:
Cheers,Dario
It looks like you're new here. Sign in or register to get started.