How to use Python requests to perform NTLM SSPI authentication?
<p>My goal is to authenticate my client that uses the requests library (2.11.1) in Python 3.5.2 through NTLM with SSPI so that the user does not have to manually enter her domain credentials (used to login to the PC).</p>

<p>I have found the following possibilities, but none work for me:</p>

<ul>
<li><p><a href="https://stackoverflow.com/questions/34991883/authorise-with-current-user-credentials-for-python-script-accessing-sharepoint-l">HttpNtlmSspiAuth</a> provokes an exception in requests:</p>

<p>import requests
from requests_ntlm import HttpNtlmAuth, HttpNtlmSspiAuth</p>

<p>requests.get(site_url, auth=HttpNtlmSspiAuth())</p></li>
</ul>

<hr>

<ul>
<li><p><a href="https://github.com/kery/requests-sspi-ntlm" rel="noreferrer">requests-sspi-ntlm</a> always gets a 401:</p>

<p>import requests
from requests_sspi_ntlm import HttpNtlmAuth</p>

<p>session = requests.Session()
session.auth = HttpNtlmAuth()
session.get("<a href="http://ntlm_protected_site.com" rel="noreferrer">http://ntlm_protected_site.com</a>")</p></li>
</ul>

<hr>

<ul>
<li><p>And <a href="https://github.com/brandond/requests-negotiate-sspi" rel="noreferrer">requests-negotiate-sspi</a> also triggers an exception in requests:</p>

<p>import requests
from requests_negotiate_sspi import HttpNegotiateAuth</p>

<p>r = requests.get('<a href="https://iis.contoso.com" rel="noreferrer">https://iis.contoso.com</a>', auth=HttpNegotiateAuth())</p></li>
</ul>

<hr>

<p>Am I doing something wrong?</p>