Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Excel load via Jira API used to be great before Basic authentication deprecated

Dominic_Phillips June 8, 2020

I’ve created a token as required, but no matter what I try, I cannot get access to Jira API anymore. I’m sure the new approach is more secure, but it’s useless if I can’t use it. Most of the VBA examples online still demonstrate the use of Basic authentication, which doesn’t help.

1 answer

1 accepted

0 votes
Answer accepted
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 10, 2020

Hello @Dominic_Phillips ,

Welcome to the Atlassian Community!

Please notice that basic authentication is still available in Jira Cloud:

 

The only difference is that now you have to use email address and API Token rather than username and password.

 

Therefore, there are chances you might be trying to use the API Token with bearer authentication and that's why this is not working for you. Otherwise, if this is not the case, please provide more details on what you are doing and what is failing.

 

For more details please see:

 

 

Cheers,
Dario

Dominic_Phillips June 10, 2020

The request header sent is:

Authorization: Basic <my jira login email address>:<token value supplied by Jira>

The response text I receive is:

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

Regards

Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2020

Hi @Dominic_Phillips ,

The doc you receive in response is the same one I've sent.

Now, before going any further, I'd like to double-check below things:

  1. I am not sure what you mean exactly with "token value supplied by Jira"? How do you generate the token?
  2. Can you confirm that the string <my jira login email address>:<token value supplied by Jira> is base64 encoded? 

Also:

  • Where are you entering the email address and API Token? Is it some app or integration or you are writing your own VB code?
  • Are you able to authenticate a REST API call against your instance using the same email address and api token using Curl or Postman? 

 

Please let me know.

 

Cheers,
Dario

Dominic_Phillips June 11, 2020

So your second point, in the first section, was the correct solution to the issue. Somewhere I read that it was not longer necessary to base64 encode the authorization data. Once I did this then everything worked fine when I included 'Basic' with the authorization information. 

Extremely grateful for your quick response and attempts to assist me.

However, the error response text from the API:

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

along with your online documentation suggesting that the use of 'Basic' has been deprecated is confusing and misleading

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/.

 

Cheers and thanks for your help

Like Dario B likes this
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2020

Hi @Dominic_Phillips ,

I agree saying that basic authentication is deprecated is a bit misleading.

The first documentation link should instead say something like: "basic authentication with username and password has been replaced by basic authentication with email address and api token"

 

The second link (Basic Auth for REST APIs ) clarifies and shows examples, but most likely many people would be confused by the first one and will not even open it:

This page shows you how to allow REST clients to authenticate themselves using basic authentication with an Atlassian account email address and API token

[...]

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:

  1. Generate an API token for Jira using your Atlassian Account: https://id.atlassian.com/manage/api-tokens.
  2. Build a string of the form useremail:api_token.
  3. BASE64 encode the string.
    • Linux/Unix/MacOS: bash echo -n user@example.com:api_token_string | base64
    • Windows 7 and later: bash $Text = ‘user@example.com:api_token_string’ $Bytes = [System.Text.Encoding]::UTF8.GetBytes($Text) $EncodedText = [Convert]::ToBase64String($Bytes) $EncodedText
  4. 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"

 

I will see if the first link can be fixed.

Finally, please accept my answer so that the thread will be marked as resolved.

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events