ANN: python-ntlm - provides NTLM support, including an authenticationhandler for urllib2

M

Matthijs

Announcing: python-ntlm
http://code.google.com/p/python-ntlm/

python-ntlm is a library that provides NTLM support, including an
authentication
handler for urllib2.

This library allows you to retrieve content from (usually corporate)
servers protected with windows authentication (NTLM) using the python
urllib2.

For more details and downloads visit:
http://code.google.com/p/python-ntlm/


== Example Usage ==

import urllib2
from ntlm import HTTPNtlmAuthHandler

user = 'DOMAIN\User'
password = "Password"
url = "http://ntlmprotectedserver/securedfile.html"

passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, url, user, password)
# create the NTLM authentication handler
auth_NTLM = HTTPNtlmAuthHandler.HTTPNtlmAuthHandler(passman)

# 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())
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top