I'm using the CRM SDK to talk to CRM.
My organization has Dynamics CRM 365(On-Premise) with IFD authentication. When I am trying to connect to CRM it is showing some random behavior. Sometimes I am able to connect using AD authentication,sometimes through OnlineFederation and the most weird connection was through Live ID. In case of IFD authentication it should not connect using LiveID. I am using connection string in the following format for IFD authentication:
connectionString = $"AuthType=IFD;ServiceUri={ organizationUri }/{ AuthInfo.OrganizationUniqueName };Domain={ AuthInfo.Domain };Username={ AuthInfo.Domain }\\{ AuthInfo.UserName };Password={ AuthInfo.Password };";
I am using IDataDictionary
to maintain auth information in cache. Whenever my service trying to connect to CRM using cache I am getting the following error:
System.InvalidOperationException: The user authentication failed! at Microsoft.Xrm.Sdk.Client.ServiceProxy`1.AuthenticateCore()
I am able to check key value of cache it exists but unable to create service proxy. serviceClient.OrganizationServiceProxy.Timeout = TimeSpan.MaxValue;