Sharepoint anonymous access to layouts folder in anonymous web application

permissionssharepointsharepoint-2013

I have a Sharepoint Foundation server 2013 with a Web Application deployed, a root Site Collection and another Site Collection in this Web Application. The Web Application is configured for Anonymous Access, the second Site Collection requires Sharepoint authentication (MS TMG).

I have Application Pages that are deployed to the server (scope = web), these Application Pages are used within the second Site Collection by users and so require authentication, which works as desired. Those Application Pages must also be accessible anonymously, they are of course in the _layouts folder and so are included in the root Site Collections _layout path, this part does not work.

I can access anonymously the root server address https://myserver.mycompany.co.uk/
(maps to https://myserver.mycompany.co.uk/_layouts/15/start.aspx#/SitePages/Home.aspx which is turn maps to https://myserver.mycompany.co.uk/SitePages/Home.aspx). I cannot however get anonymous access to https://myserver.mycompany.co.uk/_layouts/15/mysite.ApplicationPages/MyPage.aspx?QueryString=etc
It requires authentication and of course works when I provide authentication.

Suggestions? More info required?

Best Answer

// This
public partial class DoWithComment : UnsecuredLayoutsPageBase
{
    // And this was required as well
    protected override bool AllowAnonymousAccess
    {
        get
        {
            return true;
        }
    }
}
Related Topic