Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 9244

Error while using DefaultNetworkCredentials in Visual Web Part that connects to CRM 2011 Organization.svc

$
0
0

Hi,

I created a simple visual web part in SharePoint 2013 onpremise that connects to CRM 2011 OnPremise ( both on the same box and the user is admin in both CRM and SharePoint) .

The web part creates contact records in CRM 2011. The issue i am facing is when i am using defaultcredentials 

  credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;

I am getting some faultexception, however it works properly when i pass the username, password and domain

  credentials.Windows.ClientCredential = new System.Net.NetworkCredential("username", "password", "domain");

What could be the reason for this?

And what can be the solution if we want the service to run under the context of the logged in user?

Thanks,

Nishant Rana


http://nishantrana.wordpress.com https://twitter.com/#!/nishantranacrm


Viewing all articles
Browse latest Browse all 9244

Trending Articles



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