Wednesday, 27 December 2017

Difference between CRM On-prem and Online Organization Service Authentication

Microsoft Dynamics CRM Organization service uses a slightly different method for authentication for CRM online version as compared to CRM on-premise. The difference between them is highlighted below:

//client credentials object
ClientCredentials credentials = new ClientCredentials();
credentials.SupportInteractive = false;

//when using CRM online
credentials.UserName.UserName = "test@test.com";
credentials.UserName.Password = "test123$";

//when using CRM on-premise
credentials.Windows.ClientCredential = new System.Net.NetworkCredential("test", "test123$", "test");

//create Organization service object
OrganizationServiceProxy proxyService = new OrganizationServiceProxy(new Uri(OrganizationURL), null, credentials, null);

No comments:

Post a Comment