This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: urllib2 authentication redirection error(?)
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: allanbwilson, facundobatista
Priority: normal Keywords:

Created on 2004-11-22 17:30 by allanbwilson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg23245 - (view) Author: Allan B. Wilson (allanbwilson) Date: 2004-11-22 17:30
I am trying to use urllib2 to retrieve a page from a
site requiring authentication. I supply the
authentication parameters, which succeed, and *a* page
is returned -- but not the page I originally requested.
As it turns out, the authentication is handled at a
completely different URL (actually a different domain);
I can confirm this by not supplying authentication
data, because I see a 302 earlier in the traceback when
authentication fails.

What I think is happening is that the redirect happens
to the authentication site, but the original URL that I
wanted has been forgotten. The page I get back is the
default page for the original (now authenticated) site,
not the page itself, which is deeper down in the site

Sorry, I can't supply a patch!

msg23246 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2004-11-24 12:09
Logged In: YES 

Duplicate of #1070735.
msg23247 - (view) Author: Allan B. Wilson (allanbwilson) Date: 2004-11-24 22:05
Logged In: YES 

Thanks for eliminating the duplicate bug report.

As extra info on the reported problem, the latest versions
of Internet Explorer and Firefox handle the described case
fine on Windows, and Safari on OS X also knows how to deal
with it. However, Opera (only tried on Windows) has some
trouble with authentication redirected to another site.

I wasn't sure if I could/should add the above comment to the
original bug report or not.
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41206
2004-11-22 17:30:12allanbwilsoncreate