I am unable to connect to dyamics crm. I was using the same code like 8 months ago and it was working perfectly fine but now it is not working anymore.
I have created a sample application. I have creted an organization on dynamics crm trial and I am using the same same credentials to connect from my C# console application and I am getting the exception "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail." and inner exception is "Authentication Failure".
I have also tried to sync the time zone but
Here is my code
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ClientCredentials credentials = new ClientCredentials();
credentials.UserName.UserName = "xyz@myorg.co";
credentials.UserName.Password = "PasswordXYZ";
string url = "">myorg3.api.crm11.dynamics.com/.../Organization.svc";
var organizationUri = new Uri(url);
var organizationService = (IOrganizationService)new OrganizationServiceProxy(organizationUri, null, credentials, null);
if (organizationService != null)
{
var resp = organizationService.Execute(new WhoAmIRequest()) as WhoAmIResponse;
if (resp != null)
{
//return resp;
}
}
On organizationService.Execute(new WhoAmIRequest()) as WhoAmIResponse it throws exception.