Issues authenticating to CRM Online organizations "An unsecured or incorrectly secured fault was received from the other party"

Hello Developers,
This article is most interesting and life saver for who are in trouble with authenticating to CRM Online organizations. Microsoft recently announced about moving organization to integrated O365 environment. Looks awesome!! Does this mean you’ll need to revisit your code?? Yes you will need to 🙂
I’ve framed couple of questions which may cross your mind.

What has changed?
The CRM SDK has been revised with newer functions like “Authenticate()” to make our life easier. This returns security token response that is used in the service proxy constructor. We now use IServiceManagement Generic Interface to pass through authentication. For more details, please check

What error do I see when using older code against O365 based authentication?
The error is pretty generic and restricted to authentication failure in WCF layer. The typical error message is below

Do we have a sample?
Yes we do have a sample code available with helper class which is revised to embed this part. You might want to look at I have simplified the approach for smooth usage.

Is there any other thing I need to look at?
Yes you need to be aware of discovery URL changes. We now use Please refer this article to choose correct endpoints.

I also noticed a blog post available from Microsoft talking about ongoing issues with CRM Online organizations. Check out for more insights

Hope this helps!! Let me know if you have something I can add here 🙂


Comments (1)

  1. Sinivas says:

    Hi Apurv,

    I tried the code given in program.cs , but still i am getting the same error. Do I am missing something.