SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a proxy aspx page following this guide:

I deployed the solution to the farm using the two Powershell commands provided in the tutorial. When I use the proxy via javascript ajax on a page it only works when I'm logged into sharepoint. When I'm not logged in and hit the page I get a 302 (Moved Temporarily) and it tries to redirect the ajax request to the sharepoint loggin page for my site. It's as if the proxy page in the solution hasn't been published yet. Why is this? How do I publish the page?

share|improve this question
up vote 1 down vote accepted

The source code the project can be found over here on CodePlex:

This article ( suggests that in order to use custom application pages (which is what the Proxy page is) with anonymous users you need to override the AllowAnonymousAccess setting.

protected override bool AllowAnonymousAccess 
      get { return true; }    

Download the source code and then add the code above to the Proxy.aspx.cs file before the OnInit call like such:

public partial class Proxy : LayoutsPageBase
    protected override bool AllowAnonymousAccess 
          get { return true; }    
    protected override void OnInit(EventArgs e)
share|improve this answer
BTW, the reason this isn't in the main project is that it could be a security concern and should only be made available to anonymous users when necessary. – John Chapman Apr 26 '12 at 17:34
Good point, I'll just deny any request that's not to the only url I need this for. – WSkinner Apr 26 '12 at 19:01
Another thing you could do is add some functionality to the proxy page that retrieves the URL from a list by the ID. That way it can only return content you have added to that list. (And when referencing the proxy page, you would give the ID rather than the page URL) – John Chapman Apr 26 '12 at 20:51
that worked, thanks! – WSkinner Apr 26 '12 at 20:57
Awesome. I should probably add some additional functionality (like this) to the base project in a configurable way. When I get the time. /sigh – John Chapman Apr 26 '12 at 21:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.