Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ANN: python-ntlm - provides NTLM support, including an authenticationhandler for urllib2

Reply
Thread Tools

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

 
 
Matthijs
Guest
Posts: n/a
 
      12-10-2008
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())
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ntlm authentication for urllib2 Jorge Alberto Diaz Orozco Python 0 11-30-2012 02:27 AM
Add NTLM proxy authentication to urllib2 looping Python 4 09-08-2006 05:53 PM
Problem with: urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) Josef Cihal Python 0 09-05-2005 11:26 AM
hosting that provides iis app ext mappings Navain Goksin ASP .Net 1 07-12-2004 09:33 PM
control for asp.net that provides drag-n-drop screen elements? Gene ASP .Net 2 04-19-2004 03:10 AM



Advertisments