469,915 Members | 2,697 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,915 developers. It's quick & easy.

Re: urllib2 Basic authentication, what am I doing wrong?

On Apr 13, 2:11*pm, Michel Bouwmans <mfb.chikaz...@gmail.comwrote:
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/Coo.../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/Coo.../Recipe/267197
max
Jun 27 '08 #1
1 1188
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Max Erickson wrote:
On Apr 13, 2:11*pm, Michel Bouwmans <mfb.chikaz...@gmail.comwrote:
>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/Coo.../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/Coo.../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)

iD8DBQFIAovCDpaqHmOKFdQRAuHXAJ9vGNdR2e8s8iA0Z5zIzx ASjES3LgCfbVSU
339iu5iO1rv1Ufh0xNntNeY=
=2xbX
-----END PGP SIGNATURE-----
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by O. Koch | last post: by
2 posts views Thread by Andre Bocchini | last post: by
4 posts views Thread by bmiras | last post: by
5 posts views Thread by Pascal | last post: by
1 post views Thread by Fuzzyman | last post: by
1 post views Thread by news.corp.adobe.com | last post: by
3 posts views Thread by m.banaouas | last post: by
1 post views Thread by darran | last post: by
reply views Thread by Astan Chee | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.