Friday, January 25, 2008

Enabling Anonymous Access in SharePoint 2007

It wasn't too long ago that I was trying to get my favorite Web Part (Content Query Web Part) to pull an RSS feed form a SharePoint list. Web Part was giving me a lot of grief, repeatedly giving me the error:

Cannot retrieve the URL specified in the XML Link property. For more assistance, contact your site administrator.

It took me a while to piece together that this Web Part does NOT run in the context of my given SharePoint credential when it comes to fetching this RSS. In fact I don't know of ANY RSS able Web Parts that support authenticated feeds.

As a work around I had to enable Anonymous Access for the given list. I was quite surprised when after some research I discovered that SharePoint allows you to turn on annonymous access for any of the following:

  • Everything on a site (ie. 3 sites out of a site collection)
  • Any combination of Lists and Libraries on a given site
  • No anonymous access at all

For my needs I wanted to turn it on for just ONE list (the one I wanted to expose and consume the RSS feed for). Here's how to do it.

Enabling Anonymous Access for a Single List

  1. The first thing you need to do is turn on anonymous access for the web application, this is done through the Central Administration UI. Open up the Central Administration web page, go to the Application Management tab and click on Authentication Providers under Application Security (see below).
  2. Now that this application allows anonymous access we need to turn it on for the given site. Go to the site you want to turn on anonymous access on, navigate to Site Actions->Site Settings->Modify All Site Settings. From here click on Advanced Permissions. Open up the Settings menu on the tool bar and then click Anonymous Access. Finally choose (for this example) "Lists and libraries". We're going to turn on anonymous access for exactly one list.
  3. Finally go to the list you want to turn on anonymous access for and in the List Settings, Permissions for this List and then expand the Settings menu and click Anonymous Access. From here you simply select the rights you want to give anonymous users for this list. In this case we simply choose View Items.
  4. That's it, that RSS feed should now be working!

Cheers,
Tyler

5 comments:

Donna said...

I'm trying to display an rss feed from a sharepoint blog site in another site, and can't get the process to work. A couple of questions for you :
1) You refer to a content query web part, is this the same as the content editor web part?
2) Is the RSS feed you're displaying from a list that belongs to the same site in which you're displaying the data?

Tyler Holmes said...

Hey Donna,

1) A Content Query Web Part is different from a Content Editor Web Part. The Content Editor allows you to put some text into a Rich Text Editor and have it display on a page. A Content Query Web Part allows you to pull in information from some other URL (a web page or an RSS Feed) and selectively style it with XSLT.

2) Feeds I've consumed have come from both the same site as the web part, external sites (like CNN.com) and other feeds in our clients intranet.

Good luck!
Tyler

clayton said...

Hi Tyler
I followed your instructions and I am still receiving the authenticated feeds error.

I have an announcements list that I am trying to subscribe to on the same site.

Any other details?

cheers

Ulrich said...

Worked as expected.
I just had to navigate to the subsite and enable the anonymous 'read' because inheritage of permissions was cancelled in the parent.

Tyler Holmes said...

Great to hear, thanks for letting us know Ulrich.

Best,
Tyler