Closed ma44in closed 7 years ago
Thanks for this! I will look closer at it and provide comments on Saturday.
Thanks for your nice and helpful comments. I've tried to address all points in my last commit. I've reverted Basic-Auth back to "Authorizaion"-Headers, but I could'nt test it, because it's not enabled in our environment.
The basic auth part worked great! I wrote some tests for the NTLM auth part, and fixed some details.
It was first now I understood why you checked the response code - I didn't know that the HTTP status handling disappeared when using HTTPNtlmAuthHandler :-) I added such that we throw the same error that urllib does without it.
I'm going to merge this now.
This pull-request adds NTLM-Authentication support. Therefore I've refactored the script a little bit and added the function get_response() which handles the HTTP-Request and Response in one single function.
To use NTLM authentication python module python-ntlm 1.1.0 is required.