Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

Posted on by

I'm following the article below using connection string and CrmSeviceClient to connect to a Dynamics 365 (Online) instance.

https://msdn.microsoft.com/en-us/library/mt608573.aspx

Tried changing the local time on my computer before and after the current time. Seems not working.

I have also did more test on other CRM online instance. The same code and settings works for one Dynamics CRM 2016 instance, but failed on both Dynamics 365 instances. 

Any Ideas?

The log shows message below:

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : ConnectAndInitCrmOrgService - proxy requiring authentication type : OnlineFederation
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Source : mscorlib
Method : HandleReturnMessage
Date : 09-Jan-17
Time : 3:28:32 PM
Error : An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
Stack Trace : Server stack trace:
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.ServiceModel.Security.IWSTrustContract.Issue(Message message)
at System.ServiceModel.Security.WSTrustChannel.Issue(RequestSecurityToken rst, RequestSecurityTokenResponse& rstr)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Issue(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateInternal(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateWithOrgIdForACS(AuthenticationCredentials authenticationCredentials, Uri identifier)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.AuthenticateOnlineFederationInternal(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1.Authenticate(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceConfiguration.Authenticate(AuthenticationCredentials authenticationCredentials)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ClaimsIFDFailOverAuth[T](IServiceManagement`1 servicecfg, Uri homeRealm, ClientCredentials userCredentials, ClientCredentials deviceCredentials, Int32 depthLevel, Boolean tryNetworkCred)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.CreateAndAuthenticateProxy[T](IServiceManagement`1 servicecfg, Uri ServiceUri, Uri homeRealm, ClientCredentials userCredentials, ClientCredentials deviceCredentials, String LogString)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ConnectAndInitCrmOrgService(OrganizationDetail orgdata, Boolean IsOnPrem, Uri homeRealmUri)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.InitCRM2011Service()
======================================================================================================================
Inner Exception Level 1 :
Source : Not Provided
Method : Not Provided
Date : 09-Jan-17
Time : 3:28:32 PM
Error : Invalid Request
Stack Trace : Not Provided
======================================================================================================================

Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Please go to this site and follow the instructions. alphabold.com/.../

    Once you registered the App in the Azur Portal, be sure to copy the App ID, as you will have to put it in the connection string.

  • Suggested answer
    Nishant Rana Profile Picture
    Nishant Rana 55 Microsoft Employee on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    This might help..

    nishantrana.me/.../

  • Martin Donnelly Profile Picture
    Martin Donnelly 1,010 on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Check this out: community.dynamics.com/.../908681

    I always associated this error with on-Prem as missing the Home Realm URL, but that doesn't figure for 365 Online.  Maybe something in this thread will get you in.

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Hi,

    One of the common reasons for this error is that there is a time difference between the CRM Server and the AD Server/ADFS Server. Make sure there is no time difference between these servers.

    Hope this helps.

  • D365Life Profile Picture
    D365Life on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    We are facing the same issue with a Dynamics 365 and Azure plugin. Any practical suggestions / updates.

  • Suggested answer
    Sumit Choudhary Profile Picture
    Sumit Choudhary 40 on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    It may be due to security token is expired. you should try to renew the service proxy and organisation service 

    CrmConnection connection = CrmConnection.Parse("Url = " + Dynamic365Url + ";" + "Username=" + Username + ";Password=" + Password + ";");
    Uri OrganizationUri = new Uri("https://#########.api.crm.dynamics.com/XRMServices/2011/Organization.svc");
    OrganizationServiceProxy serviceProxy = new OrganizationServiceProxy(OrganizationUri, null, connection.ClientCredentials, null);
    serviceProxy.EnableProxyTypes();
    organisationservice = (IOrganizationService)serviceProxy;

    I was facing the same issue it has been resolved when i renew the organisation service 

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Hi,

    Make sure you are using latest SDK, also please share the connection string that you are using.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Hello. Tenfold can also help in integrating Microsoft Office 365 and Microsoft and enabling click to dial in Outlook. They also support MS Dynamics integration. Our click to dial also works on webpages opened in Chrome. www.tenfold.com/.../dynamics

  • Henrik Steen Profile Picture
    Henrik Steen on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Hi,

    I had the same error but once I updated my NuGet packages/CRM DLLs to 8.2.2 I got it to work.

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Connection to Dynamics 365 - An unsecured or incorrectly secured fault was received from the other party

    Hi

    Could you please share your code?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans