Unable to authenticate with the Confluence server using sphinxcontrib.confluencebuilder
Asked by A B:

Hello, I'm trying to publish a sphinx project on a test page on confluence cloud, with the sphinxcontrib.confluencebuilder plugin for sphinx. I can authenticate with my credentials as an admin in the browser, but not via using the "make confluence" command with the same credentials. My account is not currently locked.

I'm getting this error:

\> .\\make confluence  
Running Sphinx v3.5.2  
(request to accept password from interactive session)  
Instance: <https://xxxx.atlassian.net/wiki/>  
User: xxx@yyy.com  
Password:

sphinxcontrib.confluencebuilder error:  
---  
Unable to authenticate with the Confluence server.

Ensure your username and password are correct. If your username and password is correct, you may need to unlock your Confluence account be re-logging in with your browser or asking your Confluence administrator for help.

The relevant part of the conf.py file:

extensions = \['sphinxcontrib.confluencebuilder',  
\]  
confluence_publish = True  
confluence_space_name = 'TEST'  
confluence_server_url = '<https://xxxx.atlassian.net/wiki/>'  
confluence_server_user = 'xxx@yyy.com'  
confluence_ask_password = True

I tried again by adding the line  
confluence_server_pass = 'zzz'  
and disabling the ask_password but same issue.


Answers:
author: Shannon S
body: Hi A,

Welcome to Atlassian Community! It's nice to have you join us.

I'm not familiar with the sphinxcontrib.confluencebuilder script you are using, but Cloud authenticates using an API token when using a script or other process:

* [Manage API Tokens for your Atlassian Account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/)

Can you confirm if you are using an API token? Refer to our [Atlassian Cloud developer](https://developer.atlassian.com/cloud/confluence/rest/intro/) documentation for authentication information.

Let me know if this helps!

Take care,

Shannon

comments: author: A B
body: Hi Shannon, thank you for your reply. I understand that the API token is mandatory for my usecase. As I was trying to authenticate with my raw password, it was hopeless. I can publish now. Best regards, "A B"


author: Shannon S
body: Hi A B,

I'm happy to hear you were able to authenticate with the token!

Glad I could help. :)

Take care, and have a pleasant weekend.

Shannon


author: HardikTalati
body: i have the same issue


author: HardikTalati
body: my url is correct too - getting below error

---  
Unsupported Confluence API call

DATA: \<not-or-invalid-json\>  
---


author: Thomas J Varghese
body: Any further update on this issue ?


author: Shannon S
body: Hello all,

If you encounter this issue with **Confluence Cloud** and receive an "unable to authenticate" error, please ensure you authenticate with a token following [Manage API tokens for your Atlassian Account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). If you continue having problems authenticating, [contact Cloud Support](https://support.atlassian.com/contact/).

You have a different issue if you receive any other error or are on Confluence on-Prem (Server/DC). Please raise a new question or [contact Support](https://support.atlassian.com/contact/).

Take care,

Shannon \| Atlassian Community Support


Tags: cloud

confluence-cloud

sphinx