-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error 401 #65
Comments
There doesn't appear to be any auth traffic there at all. Can you print |
Here it is ! # print response.headers
{'Content-Length': '0', 'X-Powered-By': 'ASP.NET', 'request-id': 'a281ceb9-383f-44ae-9252-4c81a29a3e93', 'Server': 'Microsoft-IIS/8.5', 'X-FEServer': 'SERV-CAS2', 'Date': 'Sun, 15 Nov 2015 20:54:15 GMT', 'WWW-Authenticate': 'Negotiate, NTLM'}
# print response.history
[<Response [401]>, <Response [401]>] |
Hmm, you seem to be struggling to auth with NTLM. NTLM is a fairly tricky auth method. Can you also run: for r in response.history:
print r.headers |
Classic Microsoft ...
|
So that's a real NTLM auth challenge. Working out why this isn't working is really going to be quite tricky, I'm afraid. =( Out of interest, does curl work out your NTLM domain? Do you want to try removing it from the requests case, and having your username just be |
yeah ... I think so, too. ^^ Yes, it does. If I am just using my |
@jeeberhardt Does it work with requests? |
Nope, if remove the ValueError: username should be in 'domain\\username' format. But if I keep <Response [501]> Is it what you wanted ? |
Nope, 501 suggests that the server doesn't like that at all. Hmm, I'm currently out of ideas for how best to debug this I'm afraid. =( |
Argh ... or maybe because of a special character in the password ? |
That's certainly possible! |
Apparently not, I just changed it and ... nothing ! So thank you again, I will stay with |
Hi Cory, thanks J. |
@jhoxx I'm not sure I fully understand that question. |
I tried to authenticate to IIS service via requests-ntlm, but it gave me a 401 repsponse. I can see the request on server, with error message pointing to "wrong passwords". This usually happens when authentication is made by NTLM version 1. Thus I would like to know if there is any way how to enforce requests-ntlm to use NTLM v2 protocol only. J. |
Currently no support exists in this library, as far as I can see. You'll need to see what code is required from our dependencies and then check whether an appropriate patch fixes your problem. |
Ok, thank you Cory. |
@jhoxx, @jeeberhardt, are you guys using Windows machines? We can try to see if the problem is coming from |
@vmuriart, Hi Vik, yes, I do use Windows and yes I can try if you help me with the API call. J. |
@jhoxx give the pr a try and import |
I'm experiencing what seems to be the same issue as @jeeberhardt described, except it only happens when using a proxy setup (by pointing http_proxy/HTTP_PROXY and https_proxy/HTTPS_PROXY environment variables to a proxy service, on Ubuntu), without the proxy settings things are working fine .. Edit: Oh wow, the auth failure was caused by http vs https and how the proxy handled that, problem solved now, the fact that http was working without proxy but failing with proxy was confusing me, seems that |
I have the same problem - however I'm using a java jespa based server which I can debug. The server works with curl, chrome, ie etc. Debugging the server I can see the ntResponse is a 24 byte array. Looking at the response from requests-ntlm I see the ntResponse is a 158 byte array. The authentication server then rejects this with error -1073741715 (0xc000006d) I realise that it's been a while but could anyone take another look please Thanks |
Update: |
I was facing the same problem and @mikeyg123 's comment fixed it. Thanks! |
Same problem, @mikeyg123 solution worked for me, thanks man. |
The problem has been clearly shown to be an issue with the ntResponse |
Ran into this problem too and downgrading fixed it for me too. It works on 0.3.0, 1.0.0 and 1.1.0 but not 1.2.0. System is Windows 10 Pro, authenticating against locally installed SSRS. |
Same here, authenticating to SharePoint 2019 on-prem. Updating to 1.2.0 breaks the authentication code, giving me an HTTP 401 and reverting to 1.1.0 fixes the issue. |
I am NET WEB API project, configured with Windows authentication, version 1.2.0 will cause my interface to error 401. Even if there are no issues with my account and project configuration, the problem will automatically disappear when downgraded to version 1.1.0 |
I encountered the same issue when using an NTLM hash for authentication and received a 401 response. Later, I solved the problem by processing the hash before passing it in. For example, you can handle it like this: def get_password_or_hash(args):
if args.password:
return args.password
elif args.hash:
return f"00000000000000000000000000000000:{args.hash.upper()}" |
I have an error 401 when I try to connect to https://xxxxx.fr/ews/exchange.asmx. It works with curl (or pycurl) but not with requests-ntlm. Thank you for your answer!
$ pip freeze | grep requests requests==2.8.1 requests-ntlm==0.2.0
Curl:
Python:
Python output:
TCPdump output:
The text was updated successfully, but these errors were encountered: