Dynamic CRM "CrmServiceClient" cannot connect using Active Directory authentication mode

I am trying to connect in the premises of Dynamic CRM 2016 from an asp.net web project. I am using the CrmServiceClient method with Active Directory authentication mode.

I get the following exception.

{"Unable to load type" Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior "from the assembly" Microsoft.IdentityModel.Clients.ActiveDirectory, Version = 3.10.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35 ".:" Microsoft.IdentityModel.Clients. ActiveDirectory.PromptBehavior "}

new CrmServiceClient( new System.Net.NetworkCredential("adminuser", "pass", "domain"), Microsoft.Xrm.Tooling.Connector.AuthenticationType.AD, "http://sample.com", "4466", "DEV", useUniqueInstance:false, useSsl:false) 

Also tried this

 new CrmServiceClient(ConfigurationManager.ConnectionStrings["CRM_CONN"].ConnectionString) 
+6
source share
1 answer

Edited, I found a solution.

I had to downgrade: Microsoft.IdentityModel.Clients.ActiveDirectory to version 2.27 to get this working. Newer versions that I tested had the same error.

Hope this works for you too!

+9
source

All Articles