web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Enable D365 Multifactor authentication programmaticaly

(0) ShareShare
ReportReport
Posted on by 836

I am using below block to get into D365 from outside, my Dynamics now using MWF due to which login is getting blocked. My client want this MWF enabled. 

https://nemely.com/blog/connect-to-multi-factor-enabled-d365-cds-programmatically-online-9-1/

I am not getting error just connection i Can't establish

Anyone has tried this any ideas?

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    the code posted there is correct, the only thing I would change is the url, should be without /main.aspx, so something like

    Url=cdsinctrial.crm.dynamics.com;

    for creating the clientid/clientsecret, follow the first part of this blog post, is the most recent and contains useful screenshots:

    https://benediktbergmann.eu/2022/01/04/setup-a-service-principal-in-power-automate/

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Have you checked the error details in crmServiceClient .CrmException and crmServiceClient .LastCrmException property?

    I hope you have assigned appropriate security roles and added Dynamics CRM Impersonation under API Permission in Azure app registration.

    Also, Modify the service url suggested by guido - docs.microsoft.com/.../use-connection-strings-xrm-tooling-connect

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 74

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans