PythonConfluenceAPI icon indicating copy to clipboard operation
PythonConfluenceAPI copied to clipboard

SPIKE: Investigate Other Means of Authentication (NTLM?)

Open rpcope1 opened this issue 10 years ago • 1 comments

@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.

rpcope1 avatar Nov 11 '15 21:11 rpcope1

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=(',', ': '))

yangyixizg avatar Nov 12 '15 07:11 yangyixizg