2
Vote

An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.

description

i am getting Error "An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail."tail."

file attachments

comments

jchisman1 wrote Dec 13, 2016 at 2:34 PM

Inner exception reads "Invalid request".

seanmcne wrote Dec 14, 2016 at 2:12 PM

Can you try this block of code in roughly the same spot or in your main method just to see if that works properly. Are you using this against online or onprem?
        var instanceRoot = "https://demoOrg.crm.dynamics.com";
        var ServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(String.Format("{0}/XRMServices/2011/Organization.svc", instanceRoot)));
        var onlineUsername = "testuser@demo.onmicrosoft.com";
        var onlinePW = "plainTextPW_DontDoThisInProduction!";
        var userPrincipalName = ServiceManagement.AuthenticationType == AuthenticationProviderType.OnlineFederation
                            ? onlineUsername
                            : null;

        var Credentials = ServiceManagement.Authenticate(
                    new AuthenticationCredentials()
                    {
                        ClientCredentials =
                        {
                            UserName =
                            {
                                UserName = onlineUsername,
                                Password = onlinePW
                            }
                        },
                        UserPrincipalName = userPrincipalName
                    });

saddamkhan wrote Dec 15, 2016 at 3:21 AM

Hello, thank you for the reply.
I am getting this error when I am using Dynamic 365
In some old crm it works properly.
Can you please help me

wrote Dec 15, 2016 at 5:02 PM

seanmcne wrote Dec 15, 2016 at 5:02 PM

Please ensure you're using the XRM core V8.0 (your SDK version must be above 8.0.2). Here is an attached sample you can run to try it out.