Recently i am getting Authentication error in Jira rest API. Is there any change?
Hi Mumtaz,
Yes, Atlassian Cloud recently deprecated the use of clear text passwords and cookie based authentication in the Basic auth methods. There is a notice about this in Deprecation notice - Basic authentication with passwords and cookie-based authentication.
It is still possible to use Basic Authentication with Atlassian Cloud, but in order to do so now, you would need to create an API Token. There are also examples of using this API token in Basic auth for REST APIs. The use of this token require you to first base64 encode your account's emailaddress:API_Token_string and then supply that encoded string in an auth header:
Supplying basic auth headers If you need to, you may construct and send basic auth headers yourself. To do this you need to perform the following steps: Generate an API token for Jira using your Atlassian Account: https://id.atlassian.com/manage/api-tokens. Build a string of the form useremail:api_token. BASE64 encode the string. 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" \ "<a href="https://your-domain.atlassian.net/rest/api/2/issue/QA-31" target="_blank" rel="nofollow noopener noreferrer">https://your-domain.atlassian.net/rest/api/2/issue/QA-31</a>"
If you need to, you may construct and send basic auth headers yourself. To do this you need to perform the following steps:
useremail:api_token
Authorization
Basic
fred:fred
ZnJlZDpmcmVk
curl -D- \
-X GET \
-H "Authorization: Basic ZnJlZDpmcmVk" \
-H "Content-Type: application/json" \
"<a href="https://your-domain.atlassian.net/rest/api/2/issue/QA-31" target="_blank" rel="nofollow noopener noreferrer">https://your-domain.atlassian.net/rest/api/2/issue/QA-31</a>"
I hope this helps,
Andy
It looks like you're new here. Sign in or register to get started.