title: Sharepoint ODATA API & how to authenticate using service account
body: <p>I am calling the SharePoint 2010 REST/ODATA api and by default the data context uses DefaultCredentials, which is really the logged-in user of my Asp.Net application. If I don't attach DefaultCredentials to the context, then I just get 401 Unauthorized.</p>
  
  <p>I was wondering how to call SharePoint API while using the Application Pool credentials? I am trying to follow the trusted systems security approach. Otherwise the SharePoint site needs to grant ODATA access and certain lists need be writable by basically everyone (gak!).</p>
  
  <p>For example, with a SQL connection, I would just set "Integrated Security=true" to use the application pool credentials.</p>