Question

I have an asp.net application and a SharePoint application which uses windows authentication and are on the same domain. From the asp.net application, I am making some managed client OM calls to the SharePoint site.

When I deploy the asp.net site to IIS with one of the OOB application pools, the site gives a 401 error on pages where the client OM is used. Creating a new app pool account with a user who has access to the SharePoint site works great - no errors.

Since both of the sites are windows auth and on the same domain, how can I make a request to SharePoint under current user's context instead of the app pool identity?

Any help with this will be greatly appreciated.

Thanks!

Was it helpful?

Solution

You'd have to turn on impersonate in the webapp. This way requests done to underlying systems are done using the currently logged in user's identity. This works on local machines only though and is thread specific. To send the current user's identity to other systems, delegation is also required:

ASP.NET Impersonation & Delegation

http://msdn.microsoft.com/en-us/library/aa292118(v=vs.71).aspx

The Client OM and auth.

http://www.zimmergren.net/archive/2009/11/30/sp-2010-getting-started-with-the-client-object-model-in-sharepoint-2010.aspx

Sending credentials in code:

http://social.msdn.microsoft.com/Forums/en/sharepoint2010programming/thread/16cd0e26-8f3b-4ef2-bac4-c2c59849ab96

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top