Using CRM Web Api with SSO hosted environment

I can easily connect the CRM web api to an on prem installed setup with the following code.


           Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService appFxWebService = new Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService

            {               

                Url = "http://crmdev01/bbappfx/AppFxWebService.asmx",

                Credentials = System.Net.CredentialCache.DefaultNetworkCredentials

            };


But if I can not figure out how to connect to a hosted environment with SSO.

 

Comments

  • Try the following block of code and see if it doesn't work for you:


            /* In the blow code you would replace someusername with the username of the SSO account, and you'd also replace abc123 with the password of the SSO account */
            System.Net.NetworkCredential customCredentials = new System.Net.NetworkCredential("someusername", "abc123");


            Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService appFxWebService = new Blackbaud.AppFx.WebAPI.ServiceProxy.AppFxWebService

            {

                Url = "http://crmdev01/bbappfx/AppFxWebService.asmx",

                Credentials = customCredentials

            };


    Also you're gonna want to make sure that the url is the url to your SSO hosted environment and that whatever machine you run the API on has permissions on your hosted environment.

Categories