Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,523
Community Members
 
Community Events
184
Community Groups

I want to get the Confluence page content through python but SSO is enabled for that. please suggest

Kotesh Nataru
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 21, 2023

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)

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events