Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ANN: python-ntlm (http://code.google.com/p/python-ntlm/)

4 views
Skip to first unread message

Matthijs

unread,
Dec 10, 2008, 4:49:56 AM12/10/08
to comp-lang-py...@moderators.isc.org
== python-ntlm (http://code.google.com/p/python-ntlm/) ==

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

0 new messages