The Client ID/Client Secret-based setup in Marketo can be done for On-prem with AD FS (ver. 2016 or later). For older versions of On-prem, please reach out to Marketo Support to get the authentication method changed to be based only on User ID and Password.
Follow the steps in this Microsoft article.
When you’re done, the next step is to Enter the Dynamics CRM Generated Client Id And Secret into Marketo.
The following steps are applicable to Online and On-prem versions.
In Marketo, click Admin.
Click Microsoft Dynamics.
Click Disable Sync.
Next to credentials, click Edit.
Enter the Client Id and Client Secret you retrieved previously and press Save.
Click Validate Sync Setup.
You should see all green checkmarks. Click Close.
If you see a red X among your green checkmarks, see this article for fix options.
Click Enable Sync.
And that’s it!