MS Dynamics CRM online 2011 - Authentication Issues

I'm a complete newbie with crm online dynamics (2011), and although I worked with a sample SDK code, I'm trying to find the easiest way to make a basic authenticated connection to our Dynamics CRM online service and push some very simple data into a user object / extension that I created.

code snippet

Hopefully you will see from the code snippet above (confidential data is blurred), probably I'm trying to get around the authentication process? The above code example was slightly based on some code examples in the CRM SDK, as well as from the sample code project . I do not know if the above code will work? this actually seems to be an attempt, and only when "serviceProxy.Create" is executed do I get an authentication error.

I also managed to switch from the corporate firewall with the following addition to my app.config file:

<system.net> <defaultProxy useDefaultCredentials="true"> <proxy usesystemdefault="true"/> </defaultProxy> </system.net> 

Again, not sure if there is a very easy way to connect? or should I really go back to the SDK helper files?

+2
source share
1 answer

This is the easiest way to connect to CRM Online, you only need to add a link to Microsoft.Xrm.Sdk.Client and Microsoft.Xrm.Client.Services

 CrmConnection crmConnection = CrmConnection.Parse("Url=https://XXX.crm.dynamics.com; Username=user@domain.onmicrosoft.com ; Password=passwordhere;"); OrganizationService service = new OrganizationService(crmConnection); Entity account = new Entity("account"); account ["name"] = "Test Account"; Guid accountId = service.Create(account); 

Refers to this msdn article to create the correct connection string

Simplified connection to Microsoft Dynamics CRM

+11
source

Source: https://habr.com/ru/post/1484434/


All Articles