[twill] add_auth

Titus Brown titus at caltech.edu
Tue Sep 19 11:00:37 PDT 2006


On Tue, Sep 19, 2006 at 06:56:57PM +0100, John J Lee wrote:
-> On Tue, 19 Sep 2006, Titus Brown wrote:
-> [...]
-> > I'm glad you like twill!  Yes, the problem is almost certainly that
-> > you're using Digest Auth.  I think this is on the mechanize TODO,
-> > but I can't reach wwwsearch.sf.net to verify this.
-> 
-> Passwords and usernames added with .add_password() (and the corresponding 
-> method for proxy auth) should get used for both Digest and Basic auth.
-> 
-> 
-> > Rest assured, however, that the add_auth settings are getting through,
-> > so once digest auth is working... <grin>
-> 
-> It works for me (using mechanize direct, and a local Apache set up to do 
-> digest auth).

d'oh!  Betrayed by my reading of google results <sigh>.

Here's the code from twill:

    creds = urllib2.HTTPPasswordMgr()
    creds.add_password(realm, uri, user, passwd)
    mechanize_browser.set_password_manager(creds)

Should that work?

cheers,
--titus



More information about the twill mailing list