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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max  Erickson

    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:




    max
  • Michel Bouwmans

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

    -----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
    >Authenticati on-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:
    >

    >
    >
    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)

    iD8DBQFIAovCDpa qHmOKFdQRAuHXAJ 9vGNdR2e8s8iA0Z 5zIzxASjES3LgCf bVSU
    339iu5iO1rv1Ufh 0xNntNeY=
    =2xbX
    -----END PGP SIGNATURE-----

    Comment

    Working...