I tried using requests module and atlassian api but always ending up in having another link to download page. I used flyingpdf url in the modules. The code I used is :
import requests
url1 = "https://confluence.xxx.com/confluence/spaces/flyingpdf/pdfpageexport.action?pageId=12345667"
with requests.Session() as session:
session.auth = HTTPBasicAuth('username', 'password')
myfile = session.get(url1, verify=False)
print(myfile.url)
open("C:\\Users\\%current_user%\\Downloads\\trying" + ".pdf", 'wb').write(myfile.content)
Also, when I am using get function in requests module it not even prompting for authentication (tried both ways). The content resulting in myfile.content is some javascript.
You can copy that method which is will help you
https://github.com/atlassian-api/atlassian-python-api/blob/master/atlassian/confluence.py#L1594
I tried that method also but the resulting pdf is also containing javascript redirecting me to the company's login page. Does it have to do something with the login interface or with ssl verification (currently giving as False) ?
I also tried without giving the authentication credentials but still giving the same result. In short if I am trying with credentials also, the get method or the confluence get_page_as_pdf method is simply bypassing the authentication process.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you ever work this out by chance? I am hitting teh exact same problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah. In my case I wanted to access my company's confluence pages which are protected by siteminder authentication. So, I had to create a session with Siteminder STS ( Secure token Service) with a specific company provided URL and login into that. After this process the rest is very easily done by using requests module or using Confluence API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.