Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.