title: The remote server returned an error: (401) Unauthorized sharepoint
body: <p>Here is my scenario:</p>
  
  <p>I have my Sharepoint server hosted on <strong>Domain A</strong> and I have my machine on <strong>Domain B</strong>.
  There is <strong>not any trust</strong> between <strong>Domain A and Domain B</strong>.</p>
  
  <p>I am trying to access the Sharepoint Document library from my machine to Sharepoint server which is on Domain A.</p>
  
  <p>Now when i used this code:</p>
  
  <pre><code>ClientContext clientContext = new ClientContext(siteURL);
  clientContext.Credentials = new System.Net.NetworkCredential(username,password,domain);
  clientContext.ExecuteQuery();
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>The remote server returned an error: (401) Unauthorized 
  </code></pre>
  
  <p>I want to know if it is possible to access SharePoint document library accross the domain without having trust between each other? The only solution I can think of is my machine should be on the Domain A.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I transfered my machine on Domain A that is on that domain where sharepoint server is installed. Still same error getting at <strong>clientContext.ExecuteQuery();</strong>. I dont know why pelase help.</p>