Made a minor upgrade today to RssFeed, my open-source, custom, compiled ASP.NET server control for displaying RSS content in an ASP.NET page. Specifically, version 1.9.3 includes a new property, Credentials, that can be assigned an object that implements ICredentials. Using this new property, RssFeed can now display feeds that are protected using authentication schemes, such as Basic or Digest.
To slurp down an RSS feed that requires authentication, you'd use code like:
CredentialCache myCache = new CredentialCache();
myCache.Add(new Uri(URL_to_RSS_feed), "Basic|Digest", new NetworkCredential(username, password));
RssFeedID.Credentials = myCache;
RssFeedID.DataSource = URL_to_RSS_feed;
RssFeedID.DataBind();
That's all there is to it! The RssEngine class's GetDataSource() method includes an override that takes in an ICredentials object, which is what the class and method RssFeed class uses underneath the covers when specifying the RSS feed source as a URL.
Also added to the code base was a new exception type, FeedException, which is thrown when there is some sort of web-related exception when accessing a RSS feed from a URL. The existing exception FeedTimeoutException, which is thrown when the timeout for accessing the remote feed expires, was refactored to derive from this new base class.
Enjoy!