Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

API Token Basic Authentication

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:

HTTP/2 401 
server: AtlassianProxy/1.15.8.1
content-type: text/plain
strict-transport-security: max-age=315360000; includeSubDomains; preload
date: Wed, 13 May 2020 18:57:55 GMT
atl-traceid: 38b42bf62a17ae10
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
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?

 

 

1 answer

1 accepted

1 vote
Answer accepted

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 joe@bloggs.dom: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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

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 ...

1,826 views 0 7
Read article

Community Events

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

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you