R01k
R01k

Reputation: 795

How to use Python requests to perform NTLM SSPI authentication?

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

I have found the following possibilities, but none work for me:




Am I doing something wrong?

Upvotes: 5

Views: 25592

Answers (2)

Zach Waring
Zach Waring

Reputation: 1

Same issue here but solved when I realized I was in a adm account that doesn’t have authorization to that resource uri.

Upvotes: -1

unknown
unknown

Reputation: 61

The package requests-negotiate-sspi works for me.

I probably had the same issue with PO, but I was too lazy to try PO's solution and integrate PO's code into mine. And Google helped me out. In case anyone encounters the same exception raised from sspi.py ValueError: year 30828 is out of range, it's a known issue for python 3.6 of requests-negotiate-sspi. See here: Github-Issue

I solved this by creating a new conda environment with python 3.4. Then reinstall some dependencies as well as requests-negotiate-sspi, boom, all works.

Upvotes: 6

Related Questions