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 am using SharePoint 2010 and we have switched to using Claims Based Authentication.

When I run unit tests and running code with elevated privileges the web.CurrentUser.LoginName is "MYDOMAIN\Administrator", and an Access Denied-error for the operation that requires the elevated privileges is thrown. (I am logged in on my computer as "MYDOMAIN\Administrator")

We are expecting "i:0#.w|MYDOMAIN\Administrator", because that is what we get when running from web page.

Does anyone have a solution for this problem?

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.