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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Using Multi Factor authentication with Xrm.Tooling.CrmConnectControl

(0) ShareShare
ReportReport
Posted on by

Hello all,

I have tried logging in to an Multi Factor Authentification (MFA) enabled 365 Online environment using both the Xrm.Tooling.CrmConnectControl from the CRM SDK Template (added to existing project) downloadable at https://marketplace.visualstudio.com/items?itemName=DynamicsCRMPG.MicrosoftDynamicsCRMSDKTemplates and the one provided in the lastest SDK SampleCode called QuickStartXRMToolingWPFClient. I have not successfully logged into the MFA environment in either case. Ofcourse all the non-MFA environments I have tried to log into works as intended using both the described solutions.

In Plugin Registration Tool v.8.2.0.8411 it is possible to log into an MFA-enabled environment by leaving both User Name and Password blank when targeting Deployment Type Office 365. However when using the CrmConnectControl from the Template/SDK leaving User Name and Password blank results in the error message "A user name is required." alternatively "A password is required.". 

Does anyone know if there is a way to use the Xrm.Tooling.CrmConnectControl to authenticate to a MFA environment in the same way as it is done in the Plugin Registration Tool?

Best Regards,

Filip Sannerud

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    The release notes of www.nuget.org/.../Microsoft.CrmSdk.XrmTooling.CoreAssembly

    states that Xrm.Tooling should support MFA.

    Check your references if you have the correct version.

  • MMK Profile Picture
    745 on at

    Hi Filip

    Are you able to connect  CRM with MFA by XRMTooling

  • Suggested answer
    MMK Profile Picture
    745 on at

    Hi

    for any body who is struggling to connect old Console Application code with MFA Enabled CRM

    To Connect MFA Enabled Dynamics CRM with C# you just need to use App Password instead of your Password remaining every thing remains same as it was

                  string connectionString = GetServiceConfigurationfromAppCOnfig();

                 ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

                 CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);                

                 _orgService = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

                 WhoAmIResponse whoAmIResponse = (WhoAmIResponse)_orgService.Execute(new WhoAmIRequest());

    Follow the Steps to generate App password

    community.dynamics.com/.../connecting-to-mfa-enabled-dynamics-365-v9-x-crm-instance-through-c-or-console-app

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans