Pro Tip: Allowing Anonymous Access For A SharePoint Application Page

29 April 2012

A short and sweet one - if you're looking at creating an application page that's accessible to anonymous users of your SharePoint site, there's two things you need to do:

  1. Switch the base class of your application page from LayoutsPageBase to UnsecuredLayoutsPageBase
  2. Make sure you implement an override for the AllowAnonymousAccess property, and have it always return "true" (or some other condition of your choosing)

To be extra clear, you need to add the following code to your Application Page codebehind:

protected override bool AllowAnonymousAccess
get { return true; }

Tags: anonymous access, application page, SharePoint

Add a Comment

No Comments