I'm attempting to use the REST API using Basic Authentication with one of my JIRA account's API tokens, however all calls respond with a 401.
Here's an example CURL request (I removed the email:api_token base64 encoded string from this example)
curl -D- -X GET -H "Authorization: Basic <base64 encoded email:token>" -H "Content-Type: application/json" https://threadsculture.atlassian.net/rest/api/2/issue/createmeta
Here's the response:
strict-transport-security: max-age=315360000; includeSubDomains; preload
date: Wed, 13 May 2020 18:57:55 GMT
x-xss-protection: 1; mode=block
expect-ct: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400
Basic authentication with passwords is deprecated. For more information, see: https://confluence.atlassian.com/cloud/deprecation-of-basic-authentication-with-passwords-for-jira-and-confluence-apis-972355348.html
Is there something I am missing from the request?
I battled with this error for some time today trying every example / format under the Sun (and cursing Atlassian), until I eventually determined that I missed a character off the original token - when I copied it from a saved location, to convert it to base64 -- effectively resulting in an invalid token.
And, unfortunately - if the Token (raw or base64 encoded) is wrong - you get the "401 - Basic authentication with passwords is deprecated" error - which can be misleading.
So... I would suggest that you double-check the token and try the request without base64. i.e.
curl -D- -X GET -u firstname.lastname@example.org:xxxtokenxxx -H "Content-Type: application/json" https://threadsculture.atlassian.net/rest/api/2/issue/createmeta
Then once it is working - go back to base64 (if required / with the correct/corrected string):
curl -D- -X GET -H "Authorization: Basic xxxxxxbase64encodedxxxxxx" -H "Content-Type: application/json" https://threadsculture.atlassian.net/rest/api/2/issue/createmeta
Also note: api/3 is now in Beta.
Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster ! While we’re all excited about the new improvements to Bitbucket ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event