Geeks With Blogs


Steve Clements .Net and then some....

Recently I came up against a problem where I was getting 401 Unauthorized and 403 Forbidden errors in SharePoint on an extended anonymous only site.

It worked perfectly when using windows authentication, for any level of user.

In the end I tracked the problem down to accessing SPContext.Current

I found this article which states you should use SPSecurity.RunWithElevatedPrivileges when using the current context and it worked!!

A little surprising, but not unexpected the SharePoint logs showed nothing about this problem.

Check out the link above which gives a perfect little code snippet of how to resolve the problem.

Posted on Friday, March 9, 2012 2:24 PM Sharepoint | Back to top

Comments on this post: Gotcha: 403 and 401 errors in SharePoint using Anonymous access

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Steve Clements | Powered by: