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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Also:
Please let me know.
Cheers,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
- 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.
- 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
- 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" \ "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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.