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.

classification
Title: HTTP basic authentication problem
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: c_marinas, loewis
Priority: normal Keywords: patch

Created on 2004-07-20 15:46 by c_marinas, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch-urllib2 c_marinas, 2004-07-20 15:46 urllib2.py patch
Messages (4)
msg46406 - (view) Author: Catalin Marinas (c_marinas) Date: 2004-07-20 15:46
The regular expression matching in the
AbstractBasicAuthHandler.http_error_auth_reqed()
function in the urllib2 module doesn't work if the
authorization string returned by the server contains
one or more words in front of 'Basic realm="..."'. The
patch changes the rx.match() to rx.search().
msg46407 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-07-26 12:19
Logged In: YES 
user_id=21627

Can you please give an example of a header that is not
correctly detected?
msg46408 - (view) Author: Catalin Marinas (c_marinas) Date: 2004-07-27 08:37
Logged In: YES 
user_id=82327

I was trying to access a MS Exchange web mail account
through their Outlook Web Access (WebDAV) interface but
could not authenticate. The authorisation header returned by
the the server is: 'Negotiate, NTLM, Basic realm="..."'.

I don't know wheather the MS server complies with any
standard, but the patch solved my problem.
msg46409 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-08-03 13:01
Logged In: YES 
user_id=21627

Thanks for the patch. Applied as

urllib2.py 1.73
NEWS 1.1063
urllib2.py 1.53.6.7
NEWS 1.831.4.135
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40605
2004-07-20 15:46:19c_marinascreate