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

Need ability to authenticate as "current user" without passing username/password #21

Open
GoogleCodeExporter opened this issue Mar 19, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

I would like to be able to write code like this.
Note that I don't specify username and password. 
I want to make a request using NTLM authentication with the credentials of the 
user making the call. 
This should in theory be pretty easy to do (not easy for me though). I think 
there are some clues in this post
http://stackoverflow.com/questions/2916396/smtp-through-exchange-using-integrate
d-windows-authentication-ntlm-using-python

--- snip ---

import urllib2
from ntlm import HTTPNtlmAuthHandler

url = "http://ntlmprotectedserver/securedfile.html"
# create the NTLM authentication handler
# since we aren’t passing a password manager, use credentials
# of calling user
auth_NTLM = HTTPNtlmAuthHandler.HTTPNtlmAuthHandler()

# create and install the opener
opener = urllib2.build_opener(auth_NTLM)
urllib2.install_opener(opener)

# retrieve the result
response = urllib2.urlopen(url)
print(response.read())

Original issue reported on code.google.com by kevin.ma...@gmail.com on 28 Sep 2010 at 11:16

@GoogleCodeExporter
Copy link
Author

python-ntlm is most useful when you do not have the option to `import sspi` 
(not running on Windows)...

Original comment by dho...@gmail.com on 18 Jan 2011 at 3:23

@GoogleCodeExporter
Copy link
Author

I agree with both the need to support this when running on Windows and the need 
to use alternate auth handlers when running elsewhere.  I'm not sure how to 
best integrate the proposed solution.  I'll think about it and get back to you.

Original comment by samw...@gmail.com on 12 Feb 2013 at 12:50

  • Changed state: Accepted
  • Added labels: Security, OpSys-Windows, Usability

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

No branches or pull requests

1 participant