Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 123975

Forum Post: RE: IFD CRM login with Default Network credentials

$
0
0

Ok, so you are trying to connect via code but don't want to hard code the username and credentials. Most likely your missing an SPN (Service Principal Name) from the CRM Server for HTTP. First check those using my post here:.

http://cognettacloud.com/?p=97 - The same applies even though your not fixing a report issue, you need to confirm that the SPN's are in place for the service accounts. Next you can use this code:

The code should look like this:

       private static OrganizationServiceProxy getCrm2011Service()

       {

           String svcEndpoint = String.Format("microsoft.com/.../Organization.svc");

           ClientCredentials creds = new ClientCredentials();

           creds.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;

           return new OrganizationServiceProxy(new Uri(svcEndpoint), null, creds, null);

       }

If you set a break point you should be able to see the default credentials being past.


Viewing all articles
Browse latest Browse all 123975

Trending Articles



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