Hi - I am trying to connect to Confluence with the Atlassian python API using Oauth 2.0 with a bearer token as required by my company because we have our own domain and use multi-factor authentication.
The link below shows the different authentication methods.
https://atlassian-python-api.readthedocs.io/index.html
I have tested my token and URL using the below on the command line and it works (token and content shown below are fake)
curl -H "Authorization: Bearer XYMWODLW" https://wiki.mycompany.com/rest/api/content/123
I am having trouble translating this to one of the authentication methods in the link. Bearer tokens are typical in Oauth 2.0. When I reference the Oauth 2.0 section, I get the below code.
from atlassian.bitbucket import Cloud
# token is a dictionary and must at least contain "access_token"
# and "token_type".
oauth2_dict = {
"client_id": client_id,
"token": token}
bitbucket_cloud = Cloud(
oauth2=oauth2_dict)
# For a detailed example see bitbucket_oauth2.py in
# examples/bitbucketMy questions:
1. Does this also work for Confluence?
2. Where do I get client_id?
3. What is the actual format? Example shown below. (I was unable to find bitbucket_oauth2.py to reference)
oauth2_dict = { "client_id": client_id,
"token": {"access_token" : "XYMWODLW",
"token_type" : "Bearer"
}
}