473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1282
-----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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: O. Koch | last post by:
Until now, i know that ftplib doesn't support proxies and that i have to use urllib2. But i don't know how to use the urllib2 correct. I found some examples, but i don't understand them. Is...
2
by: Andre Bocchini | last post by:
I'm having some trouble using proxy authentication. I can't figure out how to authenticate with a Squid proxy. I know for a fact the proxy is using Basic instead of Digest for the authentication....
4
by: bmiras | last post by:
I've got a problem using urllib2 to get a web page. I'm going through a proxy using user/password authentification and i'm trying to get a page asking for a HTTP authentification. And I'm using...
5
by: Pascal | last post by:
Hello, I want to acces my OWA (Outlook Web Acces - http Exchange interface) server with urllib2 but, when I try, I've always a 401 http error. Can someone help me (and us)? Thanks. ...
1
by: Fuzzyman | last post by:
I'm trying to do Basic authentication using urllib2 and HTTPPasswordMgr Objects. According to my understanding I ought to perform the following simple sequence (except it doesn't work). Can...
1
by: news.corp.adobe.com | last post by:
I need to perform basic authentication and I also need to be able to use the put and delete methods to copy files / delete files on a server. Here is how I successfully perform basic...
3
by: m.banaouas | last post by:
Hi all, I started to use urllib2 library and HTTPBasicAuthHandler class in order to authenticate with a http server (Zope in this case). I don't know why but it doesn't work, while authenticating...
1
by: darran | last post by:
I'm struggling with using urllib2 to access the Harvest time-tracking web service (http://www.getharvest.com/api). GET is working fine. POST is giving me a problem. Here is an example that...
0
by: Astan Chee | last post by:
Hi, Im trying to implement the logic from http://www.hypothetic.org/docs/msn/general/http_connections.php to a simple python code using urllib2 and some parts of urllib. Im behind a http proxy...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.