web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Have you gone through the following community thread?

    community.dynamics.com/.../219443

  • Suggested answer
    Alagunellaikumar Profile Picture
    6,212 on at

    Hi

    Could you please share your code?

  • Henrik Steen Profile Picture
    on at

    Hi,

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

  • Community Member Profile Picture
    on at

    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

  • Suggested answer
    tw0sh3ds Profile Picture
    5,600 on at

    Hi,

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

  • Suggested answer
    Sumit Choudhary Profile Picture
    40 on at

    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 

  • D365Life Profile Picture
    on at

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

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Martin Donnelly Profile Picture
    1,030 on at

    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.

  • Suggested answer
    Nishant Rana Profile Picture
    11,325 Microsoft Employee on at

    This might help..

    nishantrana.me/.../

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans