Programmatically authenticate multi-factor enabled Dynamics 365 CRM environment
Introduction
I observed that, recently our clients are focusing more towards security aspect and hence the typical first thing they do is enabling multi-factor authentication. Now from developer’s perspective, there is no issue in accessing CRM through User Interface, because developers can get OTP on their mobile phones.
But, many times we use different third-party applications like XRMToolBox to connect to Dynamics CRM or use plugin registration tool to connect to organization. In such scenarios, we get an error even after putting correct credentials.
This blog explains solution to above problem.
Problem Statement
If multi-factor authentication is enabled for Dynamics 365, then developers could not connect to CRM via programming or Plugin Registration Tool or XrmToolbox etc., using their own password.
Solution
There is very simple solution which requires only below 2 steps:
- Follow this article to generate App Password.
- Once app password is generated and noted down from above step, use that password instead of your default password.
Hope you find this information useful!!!
This was originally posted here.
*This post is locked for comments