urllib2 Basic authentication, what am I doing wrong?

Michel Bouwmans mfb.chikazuku at gmail.com
Sun Apr 13 18:39:58 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Max  Erickson wrote:

> On Apr 13, 2:11 pm, Michel Bouwmans <mfb.chikaz... at gmail.com> wrote:
> 
>> Using this nice class (adapted to urllib2) as a basehandler I see that no
>> Authentication-header is being send
>> out:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440574
>>
>> What am I doing wrong here? I spend almost my entire free time today on
>> this and couldn't find any problem with my code, anyone else has a
>> thought? Thanks in advance.
>>
>> MFB
> 
> I've attempted to use a password manager and auth manager and failed
> in the past, so this is only a guess, but presumably, between the
> realm and uri that you are providing to the password manager, it isn't
> providing a password for the page you want to load. I've had success
> just explicitly setting the authorization header, using the method
> discussed in the comments on this page:
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/267197
> 
> 
> max

Thanks for that tip. I tried that and found out that I was still being
rejected eventhough the correct Authorization was being send. I then
experimented a bit with liveHTTPheaders and it's replay function in firefox
and found out that it needed the cookie to succesfully authenticate. I'll
try to fix it with that knowledge. Strange software I'm dealing with here,
that's for sure.

MFB
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFIAovCDpaqHmOKFdQRAuHXAJ9vGNdR2e8s8iA0Z5zIzxASjES3LgCfbVSU
339iu5iO1rv1Ufh0xNntNeY=
=2xbX
-----END PGP SIGNATURE-----



More information about the Python-list mailing list