Basic Auth still works on Confluence Cloud, but you have to use an Atlassian API Token as password and your Atlassian Id email as username.
You will get the error "Basic auth with password is not allowed on this instance" also if you provide a wrong username/password. This should be fixed by Atlassian to avoid confusion.
So try again with a valid Atlassian Id + API token.
Authorization: Basic yourBase64EncodedUsernameColonPassword
Hi @Lukas Gotter ,
On my side If I do a test with Insomnia :
It's work fine
But If I do the same test in VBA with MSXML2.XMLHTTP60 and I setRequestHeader "Authorization", "Basic " & sEncbase64Auth
I alway have an empty response while I use the same credential
Do you have any idea from the reason of this specific response on VBA ?
Below my VBA code:
Private Function UserPassBase64(text As String) As String
Dim objXML As MSXML2.DOMDocument60
Dim objNode As MSXML2.IXMLDOMElement
Dim arrData() As Byte
arrData = StrConv(text, vbFromUnicode)
Set objXML = New MSXML2.DOMDocument60
Set objNode = objXML.createElement("b64")
objNode.DataType = "bin.base64"
objNode.nodeTypedValue = arrData
UserPassBase64 = objNode.text
Dim JiraService As New MSXML2.XMLHTTP60
Dim sUsername As Variant
Dim sPassword As Variant
Dim sRestAntwort As Variant
Dim sStatus As Variant
Dim sEncbase64Auth As Variant
sUsername = "" 'Atlassian e-mail of your account
sPassword = "" 'Token generated by https://id.atlassian.com/manage/api-tokens
sEncbase64Auth = UserPassBase64(sUsername & ":" & sPassword)
.Open "GET", "https://xxxxxxx.atlassian.net/rest/api/3/project", False
.setRequestHeader "Content-Type", "application/json;charset=UTF-8"
.setRequestHeader "Accept", "application/json"
.setRequestHeader "Authorization", "Basic " & sEncbase64Auth
sRestAntwort = .responseText
sStatus = .Status & " | " & .statusText
Debug.Print "--------" & Now & "--------"
Debug.Print "--------" & Now & "--------"
@Stephane_arenas - interesting, because from what I understand in your VB code (wow, long time no see VB! ;)) - you get an empty json array as response. Are you sure you have the rights to browse projects? can you try another endpoint? can you reproduce the request with curl or something similar?
@Lukas Gotter , as I say on my first post with the same credential it work fine with Insomnia (Postman like). If I try curl -D- -u xxxx:yyyyyyy -X POST -H "Content-Type: application/json" https://zzzzzz.atlassian.net/rest/api/3/project . it works fine also.
If I don't use UserPassBase64 and I tried to set directly .setRequestHeader "Authorization", "Basic " & sUsername & ":" & sPassword, I have got 403 error (Basic auth with password is not allowed on this instance)
But if I change keep UserPassBase64 and I add on or tow mors characters to my e-mail adress or my token I alway have an empty json and http response to 200 even if my credential is not good.
So I think that we have an issu with credential but I don't uderstand what is the mistake
https://www.base64encode.org/ look like give the same result as my base64 function, but in my base64 function I have a LF car(10) after 72 charater.
If I tried to used directly the https://www.base64encode.org/ result (without LF) I had a 403 http Error "Basic auth with password is not allowed on this instance"
But we were on the good way to focus on base64 function
When I look timeline tab on Insomnia I notice that I don't have the same encryption for mycredential, and if I use "Insomnia credential encryption" in my vba code it's work fine.
So I worked to undestand why I had a bad encryption with my base64 function,
And I fine the solution....... I'm stupid and I don't know how to realize a simple copy paste of my API key.
After some check, I discovered that on my VBA version I had 4 extract characters in the middle of my API Token. (Perhaps I tried to start to write on ohters windows withour click on it)
I apologize for the time you spent to help a so stupid guy as me.
Hello, basic authentication has been deprecated recently:
"update your app or integration to use API tokens, OAuth, or Atlassian Connect"
Hi, thank you for your quick response.
I created an api token, concatenated it with the email and encoded it to base64 and added as a header field. Can I still use this way to access Confluence?
- Create your own custom emoji 🔥 - "Shake for Feedback" on mobile 📱 - An endless supply of GIFs via GIPHY 🤩 Is there anything quite as nice as a pleasant surprise? Comment below with what...
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