Closed Bug 277322 Opened 20 years ago Closed 20 years ago

XMLHttpRequest from chrome fails to prompt when auth needed

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.8beta1

People

(Reporter: mcs, Assigned: darin.moz)

Details

(Keywords: fixed-aviary1.0.1, fixed1.7.6, regression, Whiteboard: [ready to land])

Attachments

(2 files)

If a sidebar extension sends an XMLHttpRequest and the server returns a 401
(Auth Required), the user is not prompted for the user ID and password.  We have
seen this on MacOS and Windows XP in both Mozilla 1.7.5 and Firefox 1.0 (we have
not checked Linux).

This is a regression (we do not see this problem in Mozilla 1.7.3).

This may have been introduced by the fix for bug 267367.
To use the test case, install the .XPI, then open the sidebar by selecting View
/ Sidebar / Test Case Sidebar.	When loaded, it sends a request that requires
auth.
I can reproduce this bug using a recent trunk build of Firefox.  (I had to
manually install the extension, given some recent XPI regressions.)
Ah, the problem is that HTTP was changed recently to query for
nsIAuthPromptProvider before nsIAuthPrompt.  XMLHttpRequest doesn't implement
nsIAuthPromptProvider, so HTTP tries the LoadGroup's notification callbacks. 
Those happen to be implemented by the DocShell, and the DocShell hands back a
nsIAuthPromptProvider that respects DocShell's allowAuth flag.

So, yes... this is a pretty serious regression.
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta
Version: 1.7 Branch → Trunk
So... do we really want to be looking at loadgroups nsIAuthPromptProvider before
we look for the notification callbacks' nsIAuthPrompt?  That seems wrong...
Agreed.  I think that is the correct fix.
Attached patch v1 patchSplinter Review
Attachment #170684 - Flags: superreview?(bzbarsky)
Attachment #170684 - Flags: review?(bzbarsky)
Comment on attachment 170684 [details] [diff] [review]
v1 patch

why not declare authPromptProvider where it's first used?
Comment on attachment 170684 [details] [diff] [review]
v1 patch

r+sr=bzbarsky with biesi's nit addressed.
Attachment #170684 - Flags: superreview?(bzbarsky)
Attachment #170684 - Flags: superreview+
Attachment #170684 - Flags: review?(bzbarsky)
Attachment #170684 - Flags: review+
> why not declare authPromptProvider where it's first used?

Yeah, no reason.  That just slipped through the cracks as I was moving things
around :-/  Thanks for catching that.
Whiteboard: [ready to land
Whiteboard: [ready to land → [ready to land]
fixed-on-trunk
marking FIXED
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Darin and everyone -- thanks for fixing this so quickly.

I'd like to see this land for aviary 1.1 and 1.76 as well.
Flags: blocking1.7.6?
Flags: blocking-aviary1.1?
aviary 1.1 comes from the truk, so no further action is needed there. In
addition, this does not block the the 1.7.6 release, but you can request
approval for the 1.7 branch by "edit"ing the attachment.
Flags: blocking-aviary1.1?
Attachment #170684 - Flags: approval1.7.6?
Comment on attachment 170684 [details] [diff] [review]
v1 patch

a=mkaply for 1.7.6
Attachment #170684 - Flags: approval1.7.6? → approval1.7.6+
Adding to blocker list for the branches.  Please land quickly.
Flags: blocking1.7.6?
Flags: blocking1.7.6+
Flags: blocking-aviary1.0.1+
Comment on attachment 170684 [details] [diff] [review]
v1 patch

a=caillon (on behalf of drivers) for aviary1.0.1
Attachment #170684 - Flags: approval-aviary1.0.1+
Verified Fixed with 2/21 Firefox Aviary 1.0.1 and Trunk builds.  Couldn't test
with Mozilla 1.7.6, so if someone can verify this fix on the Suite, that will be
great.
Status: RESOLVED → VERIFIED
Verified Fixed in the Suite (using the 20050224 Mozilla 1.7 branch build). 
Thanks everyone!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: