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 contentBasic
followed by the encoded string. For example, the stringfred:fred
encodes toZnJlZDpmcmVk
in base64, so you would make the request as follows:curl -D- \
-X GET \
-H "Authorization: Basic ZnJlZDpmcmVk" \
-H "Content-Type: application/json" \
I hope this helps,
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.