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

Forum statistics

Threads
473,968
Messages
2,570,150
Members
46,697
Latest member
AugustNabo

Latest Threads

Top