magnuswatn / certsrv

A Python client for the Microsoft AD Certificate Services web page
MIT License
79 stars 26 forks source link

Added NTLM-Authentication-Support #5

Closed ma44in closed 7 years ago

ma44in commented 7 years ago

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.

magnuswatn commented 7 years ago

Thanks for this! I will look closer at it and provide comments on Saturday.

ma44in commented 7 years ago

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.

magnuswatn commented 7 years ago

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.