web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CrmServiceClient(connectionstring) issue with Home Realm Uri

(0) ShareShare
ReportReport
Posted on by
Hi, my project is using the CrmServiceClient class from Microsoft.Xrm.Tooling.Connector. The way I'm using it (by requirement) is with connection string (e.g. CrmServiceClient("AuthType=AD;Url=http://contoso:8080/Test; Domain=CONTOSO; Username=jsmith; Password=passcode")).

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)
  • mppowe Profile Picture
    70 on at

    I'm having the exact same issue.  Were you ever able to get this work? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans