ADFS setup error when using CRM 2016 and ADFS and Windows 2012 R2

An error occurred. Contact your administrator for more information” error when accessing CRM with ADFS/IFD set up.
After completing ADFS/IFD setup where ADFS is installed on a Windows Server 2012 R2 machine, you receive the below error:

 To resolve this issue you must enable Forms Authentication:

1.       Connect to the ADFS server

2.       Open the ADFS management console and click Authentication Policies

adfsauth

 

 

 

 

 

3.       Under Primary Authentication, click Edit next to Global Settings

adfsprimary

 

 

 

 

4.    Put a check mark in the Forms Authentication option on the Extranet and Intranet sections

adfserror

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5.    Click OK

6.       You should now be able to log in to CRM successfully

Thanks to Ian Holton, Client Field Engineer at Tribridge for putting this together!