PythonConfluenceAPI
PythonConfluenceAPI copied to clipboard
SPIKE: Investigate Other Means of Authentication (NTLM?)
@yixiyangh, per your request on another issue thread, I'll see what can be done about other means of authentication. I'm opening this ticket to track my investigation.
I tested your API on my localhost with Confluence 5.8, but unfortunately, the real one on the server is still Confluence 5.1. Thus, I have to use prototype REST API, which is limited only for method 'GET'. Furthermore, I have to set the environment variable 'CURL_CA_BUNDLE = my_cert.crt' for NTLM authentication. Currently, I am able to access Confluence 5.1 using prototype REST API via following packages:
Here is my example:
user = "domain\\username"
password = "password"
session = requests.Session()
session.auth = HttpNtlmAuth(user, password)
response = session.get("https://host:port/rest/prototype/1/content/{content_id}.json")
response.raise_for_status()
response=json.loads(response.text)
print "Response:\n"+json.dumps(response, sort_keys=True, indent=4, separators=(',', ': '))