title: Access denied. You do not have permission to perform this action or access this resource
body: <p>I have a DEV environment where I develop my code and I use a local Sharepoint.
  I have a TEST environment where I deploy my application and use a Sharepoint on the TEST server.
  I am using Sharepoint 2010.
  I have a client object model that I am using to save a document in a sharepoint server.
  I am using the Microsoft.Sharepoint.Client library for the following code;</p>
  
  <pre><code>    public void Save(byte[] file, string url)
      {
          using (var context = new ClientContext(this.SharepointServer))
          {
              var list = context.Web.Lists.GetByTitle(this.DocumentLibrary);
              var fileCreationInformation = new FileCreationInformation
                                                {
                                                    Content = file,
                                                    Overwrite = true,
                                                    Url = url
                                                };
              var uploadFile = list.RootFolder.Files.Add(fileCreationInformation);
              uploadFile.ListItemAllFields.Update();
              context.ExecuteQuery();
          }
      }
  }
  </code></pre>
  
  <p>When I run this code in my development environment, the document is saved on the Sharepoint as intended.
  When I deploy to the test environment when the document is saved to a different Sharepoint server, I get the following exception:</p>
  
  <blockquote>
    <p>Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: Access denied. You do not have permission to perform this action or access this resource.</p>
  </blockquote>
  
  <p>So there is a permissions issue here.</p>
  
  <p>However when I change my code on the development server to save the document to the Sharepoint on the Test server, it works. The same Sharepoint that would not save the document from my deployed application on Test. I am also logging in with forms authentication with the same user name and password.</p>
  
  <p>So why might this happen and where should I look to fix it?</p>