Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

How to pass current users credentials to a SharePoint web service.

$
0
0

I have a seperate web application running in IIS7 that uses windows authentication. I am trying to create a new sharepoint list item using the credentials of the person accessing the web page. My understandiing is with both REST(listdata.svc) and CSOM the credentials can be passed by setting .credentials to DefaultNetworkCredentials. However, the new item created shows the SystemAccount in the createdby field. No matter what I do I can't seem to create a SP item with the context of the current user. My web app correctly identifies that user as I am also access their AD properties.

RESTdc.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
CSOMctx.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials

The web application app pool for that web app is running under the context of that system account and not network service. From my understanding if I used .DefaultCredentials then I would expect the behavior I'm getting.

IIS7 setting

IMpersonation = false

Windows Authentication = true

Integrated Mode = true

I've seen many posts on the internet regarding this but no real solutions othe than use defaultnetworkcredentials. Any thoughts?

Thanks!


Viewing all articles
Browse latest Browse all 11508


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>