Above is a fairly common but vague error which I tend to run into often when doing a in-place upgrade, or organization import,/restore into deployment manager. This error generally appears for Dynamics 365 on-prem more then online. Depending on the situation, this error might appear sometimes or all the time while browsing the site. Below is a list of fixes I have done for different scenarios to get me pass this, hopefully it’s helpful for someone.
Clear the browser cache/cookies
If doing an in-place upgrade, sometimes the cache/cookies from the previous CRM version produces strange results.
Do a iisreset or server reboot
Probably the most common and easiest method, after the initial import/in place upgrade, you might notice you run into this error randomly while browsing Dynamics 365. Strangely a quick iisreset or server reboot fixes the problem.
Enable CRM data encryption
After a in place upgrade from CRM 2011 to Dynamics 365 in a development environment, one of our developers were testing the Microsoft Dynamics 365 for Outlook client. They were trying to access the installer by launching Dynamics 365 in the browser, clicking the gear icon in the top right corner and going clicking on “Apps for dynamics 365.” At that point, they would be greeted with the error, it happened on all accounts. After enabling data encryption by going to Settings > Data Management > Data Encryption, the error went away.
Re-import/re-upgrade from SQL backup
This is probably one of the last steps you want to take. I’ve ran into this error after a complete in-place upgrade. While installing the 18.104.22.1689 (KB3205084) patch, it said it completed successfully but if I viewed the logs, there was actually some SQL errors during the database upgrade. It looked like this left the CRM organization in some sort of limbo state. Whenever I tried to access CRM, I would be instantly greeted with the Invalid User Authorization error. The one thing I did notice was that in deployment manager, the organization build version was incorrect.. in fact it wasn’t even a valid build number. Deleting and re-importing the org from deployment manager didn’t work. The only solution was to restore the SQL backup (you made one of these before the upgrade right?) and re-import the organization and re-do the database upgrade. It was a huge hassle but I was two days out investigating the issue with a quickly approaching deadline, and the SQL restore/re-import would of been done in a lot less time.
Make sure you are part of the security group that is associated with the Dynamics 365 online tenant
Sometimes but rarely this error does appear in Dynamics 365 online, make sure you are part of the tenant security group in the Dynamics 365 admin portal. More information can be found here: https://support.microsoft.com/en-us/help/3210340/you-encounter-an-error-trying-to-sign-in-to-dynamics-365-online
I’ll keep adding to the list as I come across the different issues, if you have one I haven’t listed, feel free to comment the scenario and solution and I’ll add it to the list.