Closed
Bug 1308817
Opened 9 years ago
Closed 8 years ago
HTTP basic auth goes directly to 401 error page when foxyproxy is enabled
Categories
(Firefox :: Extension Compatibility, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dx, Assigned: ericjung)
References
Details
(Keywords: regression)
This is a regression introduced on 2016-09-01 between af5df7bd and d3bf9bbe, with the fix for this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1266836
Steps to reproduce:
1. Install foxyproxy standard https://addons.mozilla.org/en-US/firefox/addon/foxyproxy-standard/
2. Ensure it's enabled (toolbar icon not crossed out, set to "Use proxies based on their pre-defined patterns and priorities")
3. Go to a page requiring http basic auth, such as http://test.webdav.org/auth-basic/
Expected results:
- Get asked for user/pass
Actual results:
- Get 401 error page from the server
Other notes:
- Doesn't happen in non-e10s windows.
- One workaround I've used (before finding out that it was foxyproxy) is to pass the credentials in the url bar, in the format http://user:pass@example.com
mozregression logs:
44:38.56 INFO: Last good revision: af5df7bd1d265bb95c76b69fa4fbcc60a84094f9
44:38.56 INFO: First bad revision: d3bf9bbe73ba35c4257dcd10339f6ccecbb1fd5e
44:38.56 INFO: Pushlog:
https://hg.mozilla.org/integration/fx-team/pushloghtml?fromchange=af5df7bd1d265bb95c76b69fa4fbcc60a84094f9&tochange=d3bf9bbe73ba35c4257dcd10339f6ccecbb1fd5e
44:40.57 INFO: Looks like the following bug has the changes which introduced the regression:
https://bugzilla.mozilla.org/show_bug.cgi?id=1266836
Comment 1•9 years ago
|
||
CC'ing Eric to this bug as he might have some insight to offer. :)
Blocks: 1266836
Has Regression Range: --- → yes
Has STR: --- → yes
status-firefox50:
--- → unaffected
status-firefox51:
--- → affected
status-firefox52:
--- → affected
tracking-firefox51:
--- → ?
tracking-firefox52:
--- → ?
Keywords: regression
Comment 2•9 years ago
|
||
Hi dx, can you confirm that the problem still happens on the latest Nightly (with and without e10s)? There was a followup bug (bug 1301109) which may have fixed this.
Flags: needinfo?(dx)
Yes, still happens with nightly buildid 20161010030204
Flags: needinfo?(dx)
Comment 5•9 years ago
|
||
Makes sense to track this for 52+ as well. Will need an owner for the bug.
Updated•9 years ago
|
Flags: needinfo?(eric.jung)
Under browser console, the following error is displayed when trying to load an HTTP basic auth site:
TypeError: prompt.setE10sData is not a function[Learn More] authPromptProvider.jsm:267:11
authPromptProvider.jsm is from FoxyProxy which calls setE10sData but this function no longer exists as per the changes made https://bugzilla.mozilla.org/show_bug.cgi?id=1266836
- void setE10sData(in nsIDOMElement aBrowser, in nsIDOMWindow aOpener);
+ void setOpener(in nsIDOMWindow aOpener);
Migrating all setE10sData calls to setOpener should resolve this issue. However, i'm unsure why FoxyProxy even needs to do this in the first place.
Comment 7•9 years ago
|
||
MattN, can you take this on or help us find an owner? Thanks.
Flags: needinfo?(MattN+bmo)
Comment 8•9 years ago
|
||
Hi dolske,
could you help find an owner for this if MattN is busy working on other bugs?
Flags: needinfo?(dolske)
Comment 9•9 years ago
|
||
Password manager is Panos' thing now, so he should make any resourcing decision here.
That said, comment 6 makes this sounds like a straight-up addon-compat issue... (Thanks for the informative comment!) We changed/renamed some internal APIs, and so now FoxyProxy should be fixed to use the new interfaces. This is, unfortunately, the kind of problem that has been an issue with Firefox since the beginning, and is exactly what WebExtensions is meant to address (by giving addons stable APIs, instead of the raw gory details of Firefox internals).
In some cases we've implemented backwards-compatibility shims, but usually only when API usage is widespread and it's not practical to get addons updated in a timely manner. I think it's technically possible to do so here, but it would be more expedient for FoxyProxy to update.
Component: Password Manager → Extension Compatibility
Flags: needinfo?(dolske)
Flags: needinfo?(MattN+bmo)
Product: Toolkit → Firefox
Comment 10•9 years ago
|
||
Mark 51 fix-optional as the internal API is changed. FoxyProxy should fix this. If we have other approach to fix the backwards-compatibility, I'm still happy to take this in 51 early beta.
Comment 11•9 years ago
|
||
I agree with Justin that this is something better handled in the add-on code. From a quick glance at their website it appears to be actively maintained, so I would expect something as simple as the change in comment 6 (thanks!) to be fairly straightforward for them. Has this issue been raised in their support tracker? I see that their code is open source, so even the change described in comment 6 could be submitted to them as a patch for consideration.
Flags: needinfo?(dx)
Comment 12•9 years ago
|
||
One of the authors, Eric Jung is active on Bugzilla and has already been need info'd on this bug.
| Assignee | ||
Comment 14•9 years ago
|
||
Can anyone tell me when this code will be shipped in a final release (not nightly or beta)?
Comment 15•9 years ago
|
||
(In reply to Eric H. Jung from comment #14)
> Can anyone tell me when this code will be shipped in a final release (not
> nightly or beta)?
Bug 1266836 will ship in Firefox 51, to be released on January 24th (https://wiki.mozilla.org/RapidRelease/Calendar).
Updated•8 years ago
|
status-firefox53:
--- → fix-optional
tracking-firefox53:
--- → ?
Updated•8 years ago
|
| Assignee | ||
Comment 16•8 years ago
|
||
(In reply to PwrSurge from comment #6)
> Under browser console, the following error is displayed when trying to load
> an HTTP basic auth site:
>
> TypeError: prompt.setE10sData is not a function[Learn More]
> authPromptProvider.jsm:267:11
>
> authPromptProvider.jsm is from FoxyProxy which calls setE10sData but this
> function no longer exists as per the changes made
> https://bugzilla.mozilla.org/show_bug.cgi?id=1266836
>
> - void setE10sData(in nsIDOMElement aBrowser, in nsIDOMWindow aOpener);
> + void setOpener(in nsIDOMWindow aOpener);
>
> Migrating all setE10sData calls to setOpener should resolve this issue.
> However, i'm unsure why FoxyProxy even needs to do this in the first place.
This does not fix the problem:
var prompt = factory.getPrompt(win, Components.interfaces.nsIAuthPrompt2);
if(prompt instanceof Components.interfaces.nsILoginManagerPrompter) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1308817
prompt.setOpener(win);
}
yields the error:
JavaScript error: resource://foxyproxy/authPromptProvider.jsm, line 268: TypeError: prompt.setOpener is not a function
when visiting:
https://httpbin.org/basic-auth/someuser/somepassword
| Assignee | ||
Comment 17•8 years ago
|
||
I have no idea if this needs to be done. The code seems to work without calling either of these:
if(prompt instanceof Components.interfaces.nsILoginManagerPrompter) {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1308817
// https://dxr.mozilla.org/mozilla-central/source/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
prompt.init(win);
prompt.opener = win;
}
Is there anyone who is familiar enough with nsILoginManagerPrompter to advise?
Comment 18•8 years ago
|
||
(In reply to Eric H. Jung from comment #16)
> var prompt = factory.getPrompt(win, Components.interfaces.nsIAuthPrompt2);
> if(prompt instanceof Components.interfaces.nsILoginManagerPrompter) {
> // https://bugzilla.mozilla.org/show_bug.cgi?id=1308817
> prompt.setOpener(win);
> }
>
> yields the error:
>
> JavaScript error: resource://foxyproxy/authPromptProvider.jsm, line 268:
> TypeError: prompt.setOpener is not a function
Right, it's an attribute, not a method as you figured out in comment 17.
(In reply to Eric H. Jung from comment #17)
> I have no idea if this needs to be done. The code seems to work without
> calling either of these:
>
> if(prompt instanceof Components.interfaces.nsILoginManagerPrompter) {
> // https://bugzilla.mozilla.org/show_bug.cgi?id=1308817
> //
> https://dxr.mozilla.org/mozilla-central/source/toolkit/components/
> passwordmgr/nsLoginManagerPrompter.js
> prompt.init(win);
> prompt.opener = win;
> }
>
> Is there anyone who is familiar enough with nsILoginManagerPrompter to
> advise?
Did you read the comment at https://dxr.mozilla.org/mozilla-central/rev/8ff550409e1d1f8b54f6f7f115545dbef857be0b/toolkit/components/passwordmgr/nsILoginManagerPrompter.idl#39-45 ?
Assignee: nobody → eric.jung
Status: NEW → ASSIGNED
Flags: needinfo?(eric.jung)
Comment 19•8 years ago
|
||
You were previously doing
> prompt.setE10sData(win.gBrowser.selectedBrowser, null);
so to retain previous behaviour
> prompt.init(win);
is sufficient (leave opener null). I'd have to look more to understand if it's actually correct for all cases though.
Comment 20•8 years ago
|
||
But you also need to be doing:
> prompt.browser = win.gBrowser.selectedBrowser;
(assuming that's actually the correct browser which I kinda doubt but matches your old behaviour)
Comment 21•8 years ago
|
||
Comment 20 is assuming you're in the parent process. Otherwise it's not necessary.
Comment 22•8 years ago
|
||
I'm still having this issue with Firefox 50.1.0 (on Ubuntu 16.04) and FoxyProxy Standard 4.6.3
Disabling FoxyProxy is a workaround.
Downgrading FoxyProxy Standard to 4.5.7 or 4.5.6 is also a workaround
Comment 23•8 years ago
|
||
After upgrading to Firefox 51, the problem seems to be gone with FoxyProxy Standard 4.6.3.
Does that mean that the latest versions of FoxyProxy are only compatible with Firefox>=51?
If it's the case, they should be marked as such in install.rdf, so that users of older Firefox versions are not upgraded automatically, and keep a compatible version.
Keep in mind that not everybody want/can upgrade to the latest version of Firefox. For example the users of Firefox ESR version (which is still a 45.x for now)
| Assignee | ||
Comment 24•8 years ago
|
||
(In reply to Mossroy from comment #22)
> I'm still having this issue with Firefox 50.1.0 (on Ubuntu 16.04) and
> FoxyProxy Standard 4.6.3
> Disabling FoxyProxy is a workaround.
> Downgrading FoxyProxy Standard to 4.5.7 or 4.5.6 is also a workaround
Please use FoxyProxy Standard 4.6.5.
Flags: needinfo?(eric.jung)
Flags: needinfo?(dx)
| Assignee | ||
Updated•8 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•