Loading...

Sunday, November 18, 2012

Configure Anonymous Application Pages Without Enabling Anonymous Authentication

Without enabling the anonymous authentication on all list and libraries,It is possible to create few application pages anonymous.

1)Create in Mapped folder for Application Page in Solution Explorer.(Apply the masterpage which don't references css and js files from Style library)
2)In Code behind and .aspx of Application Page Inherit from UnSecuredLayoutBasePage
3)Implement URL authorization  (ASP.Net Concept)
In  Web.Config of this WebApp  add following section
(Use <location> configuration tag, and <allow users="?"/> to allow anonymous only or <allow users="*"/> for all
<location path="_layouts/MappedFolder/AnonymousPage.aspx">
      <system.web>
        <authorization>
          <allow users="*" />
        </authorization>
      </system.web>
    </location>

No comments: