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

Discussion in 'Python' started by Matthijs, Dec 10, 2008.

  1. Matthijs

    Matthijs Guest

    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())
     
    Matthijs, Dec 10, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Damodar Periwal
    Replies:
    0
    Views:
    317
    Damodar Periwal
    Feb 29, 2004
  2. Josef Cihal
    Replies:
    0
    Views:
    844
    Josef Cihal
    Sep 5, 2005
  3. looping
    Replies:
    4
    Views:
    1,201
    John J. Lee
    Sep 8, 2006
  4. Phlip
    Replies:
    0
    Views:
    111
    Phlip
    Mar 26, 2009
  5. Jorge Alberto Diaz Orozco

    ntlm authentication for urllib2

    Jorge Alberto Diaz Orozco, Nov 30, 2012, in forum: Python
    Replies:
    0
    Views:
    158
    Jorge Alberto Diaz Orozco
    Nov 30, 2012
Loading...

Share This Page