Hello,
I am trying to access pages via the `atlassian-python-api` library in Python. I have read through this page on authentication and tried every method, but none of them have worked for me. Each attempt, I get a 401. I have created a personal access token both through my Atlassian account, as well as directly on Confluence. Below is a code snippet - my assumption is that I am getting 401 every time due to the 2FA requirement. What is the right way to fix this so I can get access to my organization's Confluence pages via python?
Additionally, is there a login method that is something similar to opening a browser and having the user login to their Confluence account there, instead of using an API token?
from atlassian import Confluence
email = 'me@org.com'
confluence_api_token = 'confluenceApiToken'
atlassian_api_token = 'atlassianApiToken'
confluence = Confluence(
url=domain,
username=email,
password=confluence_api_token,
cloud=True)
confluence.get_all_spaces(start=0, limit=5, expand=None)