Connect Dynamics 365 Organization with Home Realm URI


When connecting Dynamics 365 organizations with multiple Active Directories’ Farms sharing the same AD Instance and using Federation for authentication, one typically is designated as the Primary/Default Active Directory, with the others serving as Secondary. This setup facilitates the seamless integration and management of multiple directories within a single domain, optimizing access and security across your Dynamics 365 organization. If the CRM is installed on the Secondary Active Directory, there might be issues with connectivity through Organization Service.

Learn more about our Dynamics 365 services

What is Home Realm Discovery?

Home Realm Discovery (HRD) is an AD FS feature where the end user gets to choose which Authentication Provider they want to authenticate against from the available Claims Provider Trusts.

Read more: Dynamics 365 Support: Navigating Microsoft’s Updates

This is what it looks like out of the box. This shows 1 additional Claims Provider.

this image shows home realm url dynamics 365

Optimize your Operations with Dynamics 365!

Let AlphaBOLD be your guide to implementing Dynamics 365 solutions that streamline processes and enhance productivity. Explore the possibilities and start your journey to operational excellence.

Request a Demo

Here, we will show you how to connect to Organization Service using the Home Realm address.

In the second step, add home Realm URI in your web.config file by using the following method

[code language=”csharp”]


Then in C# code, add the following:

[code language=”csharp”]
var credentials = new ClientCredentials();

credentials.UserName.UserName = “UserName”;

credentials.UserName.Password = “Password”;

//Organization Service URL
var OrgUrl = new Uri(“YourOrganizationURl”); //Home Realm URL
string homeRealmUri = System.Configuration.ConfigurationManager.AppSettings.Get(“homeRealmUri”); //Organization Service Proxy
if (string.IsNullOrEmpty(homeRealmUri))
service = new OrganizationServiceProxy(_organizationUri, new Uri(homeRealmUri), userCredentials, null);
service = new OrganizationServiceProxy(_organizationUri, null, userCredentials, null);
service.EnableProxyTypes(); IOrganizationService svc = (IOrganizationService)service;

Once the above code is added, IOrganizationService will be created, and you can use it to make CRM transactions.

Read more: CRM Implementation: Best Practices for Success in Your Organization

I look forward to seeing what you’ll do with Organization Service and Home Realm in Microsoft Dynamics 365.

If you have any questions or queries, please contact us

[code language=”csharp”] [/code]

Unlock your Business Potential with Dynamics 365!

Are you ready to transform your business operations and drive growth? AlphaBOLD guides you through integrating Dynamics 365 into your business strategy. Experience a seamless connection and unlock your business potential.

Request a Demo

Explore Recent Blog Posts

Infographics show the 2021 MSUS Partner Award winner

Related Posts

Receive Updates on Youtube