Skip to content
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

WindowsHttpAuthenticated, suds.transport.TransportError: HTTP Error 401: Unauthorized #55

Open
Dineshk77 opened this issue Feb 25, 2020 · 4 comments

Comments

@Dineshk77
Copy link

Dineshk77 commented Feb 25, 2020

I am having the same issue. Below is my code and logs

code:

from suds.client import Client
from suds.transport.https import WindowsHttpAuthenticated
ntlm = WindowsHttpAuthenticated(username="domain\\"+username,password=password)
client = Client(url,transport=ntlm)

error logs:

HTTP Error 401: Unauthorized
Traceback (most recent call last):
  File "c:\Python3\lib\site-packages\suds\transport\http.py", line 63, in open
    return self.u2open(u2request)
  File "c:\Python3\lib\site-packages\suds\transport\http.py", line 119, in u2open
    return url.open(u2request, timeout=tm)
  File "c:\Python3\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "c:\Python3\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "c:\Python3\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "c:\Python3\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "c:\Python3\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Development\github\fdoc-buildscripts\pythonLibs\Symbols.py", line 51, in uploadCer
    client = Client(self.cerServer["url"],transport=ntlm)
  File "c:\Python3\lib\site-packages\suds\client.py", line 110, in __init__
    self.wsdl = reader.open(url)
  File "c:\Python3\lib\site-packages\suds\reader.py", line 151, in open
    d = self.fn(url, self.options)
  File "c:\Python3\lib\site-packages\suds\wsdl.py", line 135, in __init__
    d = reader.open(url)
  File "c:\Python3\lib\site-packages\suds\reader.py", line 78, in open
    d = self.download(url)
  File "c:\Python3\lib\site-packages\suds\reader.py", line 94, in download
    fp = self.options.transport.open(Request(url))
  File "c:\Python3\lib\site-packages\suds\transport\https.py", line 61, in open
    return HttpTransport.open(self, request)
  File "c:\Python3\lib\site-packages\suds\transport\http.py", line 65, in open
    raise TransportError(str(e), e.code, e.fp)
suds.transport.TransportError: HTTP Error 401: Unauthorized

Note:

Originally posted by @Dineshk77 in #36 (comment)

@cackharot
Copy link
Owner

@Dineshk77 Assume the issue is fixed in python-ntlm3 lib and no fix/changes required on suds. If yes let me know I can close this. Thanks!

@Dineshk77
Copy link
Author

@cackharot . nope python-ntlm3 is archived and I can't create issues there.

@safe
Copy link

safe commented Jun 11, 2020

@Dineshk77 Did you find an alternative on windows or work around this?

@cackharot Since python-ntlm3 is not actively maintained anymore, any plans on moving away from this to an alternative?

@Dineshk77
Copy link
Author

@Joesafe I just forked the python-ntlm3 repo and replaced the HTTPNtlmAuthHandler.py using https://github.com/mullender/python-ntlm/blob/master/python30/ntlm/HTTPNtlmAuthHandler.py. and downloading my forked repo using pip for my scripts

git+git://github.com/Dineshk77/python-ntlm3@master#egg=python-ntlm3; python_version >= '3.0'

Kind of works but this adds the git dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants