Quantcast
Channel: Tech Blog
Viewing all articles
Browse latest Browse all 49

Gotcha: 403 and 401 errors in SharePoint using Anonymous access

$
0
0

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.


Viewing all articles
Browse latest Browse all 49

Trending Articles