You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I want to get the Confluence page content through python but SSO is enabled for that. please suggest.
I have tried through requests and Confluence package. The request is going to SSO and stopping. how can we skip the sso or any other way and get the content from confluence page. I am getting struck here. Thanks in advance!
Here is the sample code:
Through requests :
import requests
s = requests.session()
url_login = "https://xxxxxxxxx/idp/qtvBS/resumeSAML20/idp/SSO.ping"
payload = {
"username": "xxxxxx",
"password": "xxxxx"
}
req1 = s.post(url_login, data=payload)
cookies = s.cookies.get_dict()
# Now to make sure you do not get the "Access denied", use the same session variable for the request.
req3 = s.get('xxxxxxxxxxxxxxxxxxxxxxxxxxx', verify=False, cookies=cookies)
Through Confluence:
from atlassian import Confluence
confluence = Confluence(
url="xxxxxxxxxxxxxxxxxxxxxxxxxx",
username = "xxxxxxxxxxxxxxxxxxx",
password = "xxxxxxxxxxxxxxxxxxxx",
verify_ssl = False
)
page_html = confluence.get_page_by_id('1234444', "space,body.view,version,container")
print(page_html)