I am working on some SharePoint 2010 server-side code, which uses the Client Object Model (to connect to remote farms)... I can use the impersonated user account easily enough, but in some cases I need to use the local farm's SYSTEM account... unfortunately,
when I try to encapulate code within an SPSecurity.RunWithElevatedPrivileges block, I cannot find a way to impersonate the app pool service account.
How can I access the SYSTEM account's iCredentials? (whether for the SharePoint client API, an HttpWebRequest, or anything else)
The closest I seem to be able to get is within a RunWithElevatedPrivileges block, I can get the System.Security.Principal.WindowsIdentity.GetCurrent() which returns the SYSTEM account, but I'm not sure how to use that to obtain the iCredentials object.
View Complete Post