CRM MessageSecurityException and incorrect time settings
If you get
MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
An error occurred when verifying security for the message.
it's like you have a time settings issue on your system. Make sure your clock is set right, with the right time zone.
Time is an illusion. Lunchtime doubly so.
-- The Hitchhiker's Guide to the Galaxy
Some very interesting problems surround date and time in the world of computer science. If everything goes according to plan, things tend to chug along in an orderly fashion. However, ...
Nobody panics when things go "according to plan." Even if the plan is horrifying!
-- The Joker
Recently, Turkey decided to delay its DST switch by two weeks which otherwise would be in sync with Europe (Oct. 25th), because of the upcoming elections. They reasoned the extra daylight may provide additional safety for voters.
Unfortunately nobody notified Microsoft about this (or they did, but it wasn't a big enough issue to do something about it) and sure enough, when the time came, Windows systems diligently bumped their local times back an hour.
It can really mess up your day when the services you use refuse to talk to you with mystical reasons (such as the above one). You have to hold onto your sanity with both hands when you're attempting to set a time and time zone that somehow all services are happy with and you still see the correct time.
But what if you're in off the grid, in no man's land?
The way I solved it in Windows 10 is I've disabled the automatic time setting and manually set the clock. This way, the custom tools that communicate with the Organization Service finally decided that I was, once again, on time.