I was finding it impossible to connect to Dynamics 365 using the Plugin Registration Tool with an account which has Multi-Factor Authentication enabled.
With older versions of the Toolkit, I was just getting stuck in a loop where I’d successfully authenticate using MFA, be shown a list of instances, select one and then just get taken straight back to the initial login page.
With the latest version of the tool (22.214.171.124), I was getting a different problem – it wasn’t even showing me a list of instances, just giving me this error message after entering my username and password: Error : You don’t have permission to access any of the organizations in the Microsoft Common Data Service region that you specified. If you’re not sure which region your organization resides in, choose “Don’t know” for the CDS region and try again. Otherwise check with your CDS administrator.
Capturing the web traffic in Fiddler didn’t help much – I could see that the call was returning this message: “Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access” but this still didn’t help me getting the problem solved.
It wasn’t until I spoke to an engineer at Microsoft (Thanks, Trenton) that I was able to resolve the issue. When using MFA with the Plugin Registration Tool, it turns out that you must not enter your username and password in the login dialogue box!
If you leave these fields blank, when you click Login, you will get taken to the Microsoft Log-In screen as normal and this time your login will actually work!
If you think this counter-intuitive UI could be improved, you could up-vote this idea posted on the PowerApps forum.