Open Bug 271383 Opened 20 years ago Updated 2 years ago

Message body not displayed on HTTP 401 status response

Categories

(Core :: Networking, defect, P5)

x86
Linux
defect

Tracking

()

People

(Reporter: richardp, Unassigned)

Details

(Keywords: useless-UI, Whiteboard: [necko-would-take])

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

When a server returns HTTP status code 401 Authorisation Required, mozilla does
not display the message body sent by the server. This effectively severly limits
the utility of standard HTTP authentication.

In order to provide a user-friendly application, it must be possible to display
a 'friendly' page indicating that a resource is not available to the user.
Currently the only way for the user to see this page is in reponse to pressing
cancel in response to the authentication popup dialog. This is user-hostile
rather than user friendly.

A simple workaround would be to 'embed' the popup authentication dialog into the
top of the displayed 401 response. This would also allow easy use of the browser
back button - a double win.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Assignee: general → darin
Component: General → Networking: HTTP
Product: Mozilla Application Suite → Core
QA Contact: general → core.networking.http
Version: unspecified → Trunk
HTTP application developers need to offer high quality user interfaces to users
of their applications. One very common pattern is the availability of a
'password reminder' function. This should be available within the same user
interface screen as the username and password entry prompt.

Because mozilla does not display the message-body of a 401 response unless the
user presses the 'cancel' button, developers are not able to offer a sane or
useable interface to a password reminder function. Is is simply not acceptable
to expect a user to know they must press 'cancel' in order to reach this function.

This fault means virtually all web applications are now developed using non
standard cookie based authentication schemes.

This obvious browser misfeature limits the use of standard HTTP authentication.
The HTTP standard itsself is not the problem here; its the UI generated by the
user agent which is the problem.
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Even if you displayed the 401 page underneath the dialog box, it would still do
something useful.  It would indicate to the user that hitting the close dialog
box might get them something useful.
Confirming to keep on adar. I agree that we need to make HTTP auth better; is
this the way to do it?
Status: UNCONFIRMED → NEW
Ever confirmed: true
This bug exposes one of the issues surrounding the deficiencies of the HTTP authentication mechanism 
in mozilla. There is a decent TR from the W3C about extending HTML forms to add elements to handle 
authentication at http://www.w3.org/TR/1999/NOTE-authentform-19990203

The important points are the user-hostility of the popup authentication dialog, and the lack of the 
ability to supply a useful response in a 401 page. This severly limits the utility of standard 
authentication for most applications. The workaround I suggested would be a quick and dirty way 
towards something better.
Keywords: useless-UI
Hmm... there has been talk about making the HTTP authentication prompt be
asynchronous, so that it could be implemented using an info bar or some other
non-modal prompt.  I'm not sure how I feel about morphing the HTTP auth prompt
into a form in the content area of the browser.  It seems like sites can already
achieve that UI by simply returning 200 w/ a HTML form.  I understand that doing
so would not allow sites to leverage HTTP-level authentication, but that doesn't
seem to have been much of a pain-point for e-commerce.
I agree that a non-modal interface would be far better than the current
solution. And you are correct that most sites return a HTML form with a 404 (or
even 200) status. This clearly shows that the UI provided for standard
authentication is too borken for normal use.

Any my workaround suggestion is just that - there are probably far better ways
to engineer this - that should not detract from the main issues here, though,
which is that there is no way for the user to see the content of a 401 response
unless they press the 'cancel' button.

To quote RFC 2616:

>If the 401 response contains the same challenge as the
>prior response, and the user agent has already attempted
>authentication at least once, then the user SHOULD be presented the
>entity that was given in the response, since that entity might
>include relevant diagnostic information.
-> default owner
Assignee: darin → nobody
Component: Networking: HTTP → Networking
QA Contact: networking.http → networking
Assignee: nobody → sayrer
When I last checked, all major browsers *do* display the 401 page *if* they don't recognise the authentication scheme presented. This always struck me as an interesting hook to layer in a new, form-based authenticated scheme.

That may be a more realistic way forward, considering that most 401 pages out there today aren't suitable for presenting to users, and IIRC most servers don't provide a way to change the content of the 401 based on whether a bad credential was presented vs. no credential (something critical to the "friendly log in" approach.
(In reply to comment #9)
> When I last checked, all major browsers *do* display the 401 page *if* they
> don't recognise the authentication scheme presented. This always struck me as
> an interesting hook to layer in a new, form-based authenticated scheme.

Good point, and it's not as though the existing schemes are worth saving anyway.

I opened bug 356853 for OpenID-based challenge-response and bug 356855 for one based on SRP.

(In reply to comment #10)
> (In reply to comment #9)
> > When I last checked, all major browsers *do* display the 401 page *if* they
> > don't recognise the authentication scheme presented. This always struck me as
> > an interesting hook to layer in a new, form-based authenticated scheme.
> 
> Good point, and it's not as though the existing schemes are worth saving
> anyway.
> 
> I opened bug 356853 for OpenID-based challenge-response and bug 356855 for one
> based on SRP.
> 


Hmm, this could be an interesting way forward ... I await any news with interest.
I also find this bug interesting and a solution to it even more so. I'm not sure the current web architecture and standards allow for the needed extensibility in HTML Forms/HTTP Authentication consolidation, but being able to authenticate a user with HTTP Authentication through HTML forms would be a very good way to standardize authentication across all web sites, so user agents that speak something else than HTML (e.g. Atom through APP) also can authenticate on sites that have HTML Forms logins.
I have added a related issue in HTML WG's issue tracker: <http://www.w3.org/html/wg/tracker/issues/13>
Assignee: sayrer → nobody
Whiteboard: [necko-would-take]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.