title: Download a file from a Claims auth based SharePoint 2010 site programmatically
body: <p>I have a console application to download a file from a SharePoint site. The sharepoint site uses claims based authentication.</p>
  
  <p>This code throws a 403 Forbidden exception. The specified Network credential has full access to the site, and is able to download the same file from a browser. </p>
  
  <pre><code>WebClient webClient = new WebClient();
  webClient.Credentials = new NetworkCredential(username,Password,domain);
  byte[] fileData = webClient.DownloadData(urlOfAFile); 
  FileStream file = File.Create(localPath);
  file.Write(fileData, 0, fileData.Length);
  </code></pre>
  
  <p>Any idea how to fix this?</p>