Open
Bug 1029815
Opened 10 years ago
Updated 2 years ago
Prompt service should support nsIAuthPrompt2's asyncPromptAuth.
Categories
(Toolkit :: General, defect)
Toolkit
General
Tracking
()
NEW
People
(Reporter: Dolske, Unassigned)
References
(Blocks 1 open bug)
Details
Currently, the front-end HTTP auth prompt code is invoked from Gecko via nsIAuthPrompt2's asyncPromptAuth(), but in turn actually uses nsIAuthPrompt's promptAuth() and promptUsernameAndPassword() to display the UI. Specifically, Gecko ends up calling the asyncPromptAuth() provided in nsLoginManangerPrompter, which then calls the prompt service's non-async promptAuth(), which internally then calls promptUsernameAndPassword. [Yes, this is a rather confusing mess that still hasn't been cleaned up. See also bug 565582.]
This poses a couple of problems for tab-modal prompts.
1. To implement the desired UI in bug 977037, the prompt needs more detailed string information. promptUsernameAndPassword() only takes a single blob of text (e.g.: "A username and password are being requested by https://somesite.com. The site says: 'LDAP - Valid User Required'"). If the prompt UI had a API that just mirrored promptAuth(), it could construct its own strings and display them however it wants.
See http://mxr.mozilla.org/mozilla-central/source/toolkit/components/prompts/src/nsPrompter.js#833, where promptAuth() is converted into a promptUsernameAndPassword() call. As an interm step, we could add a "promptAuth" path in CommonDialog.jsm and do the equivalent of the conversion code there.
2. Tab-modal prompts using promptUsernameAndPassword() may result in nested event-loops, and all the nastyness that entails with hangs and non-responsive UI. E.G. when multiple prompts are shown in different tabs, responding to them in non-LIFO order will not work correctly! We can avoid this problem entirely by not spinning the event-loop while showing a prompt. Similar to #1, we can add a "asyncPromptAuth" path in CommonDialog.jsm. A callback is provided, so nsPrompter's openTabPrompt() doesn't need to spin the event loop [processNextEvent()] waiting for the user to respond. nsLoginManangerPrompter's _doAsyncPrompt() would then change to call asyncPromptAuth() instead of promptAuth(), allowing the whole path to be async.
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•