
I'm currently able to connect to CRM Online, On-Premise, etc. with this method except when I need to set the Home Realm Uri parameter. There is an On-Premise CRM 365 which requires Home Realm Uri to retrieve the connection, when I put the rest of the parameters and the HomeRealmUri in it I'm unable to connect (with the message from CrmServiceClient.LastCrmError being "Unable to login to Dynamics Crm").
I tested using other method to see if I had incorrect information but this approach actually worked to connect to the same CRM successfully:
OrganizationServiceProxy service = new OrganizationServiceProxy(new Uri("https://contoso.crm.dynamics.com/XRMServices/2011/Organization.svc"), new Uri("https://server-1.server.com/adfs/services/trust/mex"), credentials, null);
My current connection string looks like this:
Server=https://contoso.crm.dynamics.com/contoso;Domain=contoso;UserName=contoso\\admin;Password=passcode;HomeRealmUri=server-1.server.com/.../mex;AuthType=IFD
I've tried different sets of parameters (removing the domain from username, adding ports to the server uri, changing auth type to AD, etc.) to no avail. I've searched a lot in the web too but haven't been able to find any information about a successful connection using homerealmuri with connection string apart from Microsoft documentation.
I'd like to know if somebody has a suggestion on what could be wrong in this situation or if at least someone has worked with home realm uri with CrmClientService(connectionstring) to give me some sense of direction.
Thanks,
*This post is locked for comments
I have the same question (0)