Web authentication

Greg Jorgensen gregj at pobox.com
Mon Dec 8 15:44:29 EST 2003


luigipaioro at libero.it (Luigi) wrote in message news:<a94bfaf2.0312050659.1612f31e at posting.google.com>...

> These are my attempts:
> ...
> Both don't work!
> Where is my mistake??

Since you don't know what the problem is and you probably aren't
familiar with proxies and header sniffing, try fetching the page with
curl (http://curl.haxx.se/), which you will already have if you run
Linux. Once you have it working from the command line with curl you
can translate to Python.

Turn on curl's verbose output:

 curl -v http://user:password@www.mysite.com/page.html

Possible reasons for your problems:

- username/password wrong
- url wrong
- server not using basic authentication
- server expecting specific referrer, IP address, user agent
- secure connection (HTTPS) required

Some of these problems will be apparent from curl's output. Others
(like the referrer or user agent check) will not, but you can perhaps
deduce them from how the site works from a browser.


Greg Jorgensen
PDXperts LLC
Portland, Oregon USA




More information about the Python-list mailing list