Hi
I can't connect to CRM online with OAuth CrmServiceClient.
Whenever I try it times out. I'm going mad with this!!!
My test code is below.
Does the user need particular permissions or anything?
(.Net version 4.6.2)
using Microsoft.Xrm.Sdk; using Microsoft.Xrm.Tooling.Connector; using System; public partial class c2 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string ConnectionString = "AuthType=OAuth;Username=xxx@xxx.com;Password=xxx;Url=https://xxx.crm4.dynamics.com;AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Never"; CrmServiceClient svc = new CrmServiceClient(ConnectionString); if (svc.IsReady) { var myContact = new Entity("contact"); myContact.Attributes["lastname"] = "Test"; myContact.Attributes["firstname"] = "User1"; svc.Create(myContact); } } }