Closed Bug 260836 Opened 20 years ago Closed 20 years ago

RSS feeds which require HTTP authentication are rejected as invalid

Categories

(MailNews Core :: Feed Reader, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: chris, Assigned: mscott)

References

Details

(Keywords: fixed-aviary1.0)

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.48
Build Identifier: version 0.8 (20040913)

An RSS feed which requires HTTP authentication will be rejected as invalid rather than prompting 
the user to authenticate. 

Firefox has a similar bug with its Live Bookmarks which has already been reported (#259451) - in 
that case loading the URL manually will workaround the problem since the cached username/
password will be used when you refresh the live bookmark.

Reproducible: Always
Steps to Reproduce:
1. Attempt to subscribe to a feed which uses HTTP authentication
Actual Results:  
Thunderbird reports that the URL is not a valid feed

Expected Results:  
Prompt for a username and password
I ran across a similar problem when adding a live bookmark to an intranet site
that runs over https. The primary form of authentication is client certificates,
but the site also allows username/password authentication in certain cases.

After adding a love bookmark to the site, the live bookmarks feature would
attempt to visit the site, fail the certificate login (because it never gave me
the pin dialog) and drop back to username/password which would also fail. Then,
the next time I would visit the site, firefox would check and find that the
certificate authentication already failed once, so it goes straight into
username/password mode. I never got a second chance at the certificate login
unless I closed my browser and re-opened it.
Sorry, I meant the comment above in the firefox version of this bug.
could someone provide a test rss link which uses http authentication? thanks!
*** Bug 267836 has been marked as a duplicate of this bug. ***
seeing more http authentication bugs, so confirming for now.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
*** Bug 270363 has been marked as a duplicate of this bug. ***
There are four rss test feeds here:

http://labs.silverorange.com/archives/2003/july/privaterss

Is that what you're looking for?
Cornelius, thanks for the test feed page!

yeah, this still fails for

a. RSS with HTTP Auth, but no SSL:
http://labs.silverorange.com/local/solabs/rsstest/httpauth/rss_with_auth.xml

b. RSS with both SSL and HTTP Auth:
https://secure3.silverorange.com/rsstest/httpauth/rss_with_ssl_and_auth.xml

no js console output.

however, this does work for RSS with SSL, but no HTTP authentication (recently
fixed).
also fails on WindowsXP. nominating for tbird 1.0.

forgot to note: username/password for the HTTP auth-protected feeds is:
testuser/testpass.
Flags: blocking-aviary1.0?
Keywords: qawanted
OS: MacOS X → All
Hardware: Macintosh → All
Summary: RSS feeds which require authentication are rejected as invalid → RSS feeds which require HTTP authentication are rejected as invalid
taking

I think this is going to have the same fix as Bug #267665
Status: NEW → ASSIGNED
Flags: blocking-aviary1.0?
Target Milestone: --- → Thunderbird1.0
This issue and the issue with subscribing to a feed fails to bring up the http
proxy auth dialog are both regressions new in 0.9.

I think they are both caused by changes to nsDocShell as part of Bug #267367
where we were bringing up http auth prompts for favicon requests and other urls
running in chrome docshells. If I comment out those changes then this starts
working again. I don't have access to a proxy to test Bug #267665 to see if that
starts working again too but I suspect it will. 

cc'ing Darin as I should talk to him about possible ways to fix this for RSS.
Attached patch the fixSplinter Review
Attachment #166804 - Attachment is obsolete: true
Comment on attachment 166807 [details] [diff] [review]
the fix

This patch sets allowAuth to false for any docshell that isn't of item type
content (i.e. chrome). This allows us to get rid of the chrome check in
GetAuthPrompt and rely on mAllowAuth instead. 

That in turn allows us to modify the ::GetInterface version for nsIPrompt to
directly call GetAuthPrompt which is what Darin originally wanted to do in Bug
#267367

For the chrome docshell in mailnews (and the RSS subscription dialog), we now
explcility allow auth prompts because of the RSS case.

Note: we still disable auth prompts from the message pane so spam e-mails can't
bring up prompt notifications.
Attachment #166807 - Flags: superreview?(darin)
Comment on attachment 166807 [details] [diff] [review]
the fix

>Index: docshell/base/nsDocShell.cpp

> nsresult
> nsDocShell::GetAuthPrompt(PRUint32 aPromptReason, nsIAuthPrompt **aResult)
> {
>-    // if this docshell is of type chrome and has a chrome URI, then do not
>-    // give out an auth prompt.  NOTE: it is possible to load a non-chrome
>-    // URI into a chrome docshell, so this check is important.
>-    if (mCurrentURI && mItemType == typeChrome) {
>-        PRBool chrome;
>-        if (NS_SUCCEEDED(mCurrentURI->SchemeIs("chrome", &chrome)) && chrome)
>-            return NS_ERROR_NOT_AVAILABLE;
>-    }

We should check with jst, but I think that this is ok because 1)
we don't really care about loading non-chrome URLs into chrome
docshells, 2) other parts of the code only inspect the itemType,
and 3) if anything this is just more restrictive, not less.  So,
I think it's safe :)


>Index: mail/extensions/newsblog/content/subscriptions.js

>+  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
>+        .getInterface(Components.interfaces.nsIWebNavigation)
>+        .QueryInterface(Components.interfaces.nsIDocShell).allowAuth = true;

Isn't the last QueryInterface is extraneous?  That is, won't this
also work:

  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
	.getInterface(Components.interfaces.nsIDocShell).allowAuth = true;
this is checked into the aviary 1.0 branch so I can get testing help with this
in the short term.

Leaving open until the reviews are finished. 

Trix/Sarah, can you start trying this out in tomorrow's builds?
Keywords: fixed-aviary1.0
Hi Johnny, can you chime in if you think our assumption is incorrect here?

from comment #15: 

> nsresult
> nsDocShell::GetAuthPrompt(PRUint32 aPromptReason, nsIAuthPrompt **aResult)
> {
>-    // if this docshell is of type chrome and has a chrome URI, then do not
>-    // give out an auth prompt.  NOTE: it is possible to load a non-chrome
>-    // URI into a chrome docshell, so this check is important.
>-    if (mCurrentURI && mItemType == typeChrome) {
>-        PRBool chrome;
>-        if (NS_SUCCEEDED(mCurrentURI->SchemeIs("chrome", &chrome)) && chrome)
>-            return NS_ERROR_NOT_AVAILABLE;
>-    }

We should check with jst, but I think that this is ok because 1)
we don't really care about loading non-chrome URLs into chrome
docshells, 2) other parts of the code only inspect the itemType,
and 3) if anything this is just more restrictive, not less.  So,
I think it's safe :)
Comment on attachment 166807 [details] [diff] [review]
the fix

sr=darin with the suggested change to subscriptions.js and provided jst is ok
with this patch.
Attachment #166807 - Flags: superreview?(darin)
Attachment #166807 - Flags: superreview+
Attachment #166807 - Flags: review?(jst)
Comment on attachment 166807 [details] [diff] [review]
the fix

Yeah, looks good to me. r=jst
Attachment #166807 - Flags: review?(jst) → review+
tests from comment 8 work fine now --tested with 2004112311-0.9 on linux fc2.
now fixed on the trunk too. Closing out. 
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Looks good.  Authentication is now prompted, connection is established, and
messages are now transferred.
verified on all 20041123 builds
Status: RESOLVED → VERIFIED
This should go into 1.7.6 
Component: RSS → Feed Reader
Product: Thunderbird → MailNews Core
Target Milestone: Thunderbird1.0 → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: