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 CRM (Archived)

CRM Connection String when using On-Premise IFD and MFA

(0) ShareShare
ReportReport
Posted on by

Have recently converted an application that connects to Dynamics CRM to use the new CRM Tooling connection method. It used an old method of connecting to CRM and I needed to update the connection method to support modern CRM Online.

No problem with this part,

IOrganizationService _crmService;
string connectionString = "....my crm connection string....";
CrmServiceClient service = new CrmServiceClient(connectionString);
_crmService = (IOrganizationService)service.OrganizationWebProxyClient != null ? (IOrganizationService)service.OrganizationWebProxyClient : (IOrganizationService)service.OrganizationServiceProxy;


This all works and can connect to IFD On-Premise deployments and CRM Online.

IFD is connecting with a string in this format:

AuthType=IFD;Url=crmorg.crmprovider.com/CRMORG;Username=myuser@domain.com;Password=MyPass;Domain=LegacyDomain;

It can also support MFA with CRM Online by registering an app in Azure and configuring a connection string in this format:

AuthType=OAuth;Url=yourcrm.crm.dynamics.com;AppId=APPID;RedirectUri=http://localhost;



What I am stuck on, is the format of the string on an IFD (On-Premise) deployment using On-Premise Microsoft MFA.

When I use the OAuth method with Azure AD, the application pops up a Microsoft Sign in Assistant that handles the user/pass and two factor request.

How do I construct a CRM Connection string that will do the same with an On-Premise CRM365 Deployment using the latest ADFS and MFA components from Microsoft? I know that the On-Premise installation challenges your user/pass (via ADFS) like the Microsoft Sign in Assistant, but how do I invoke that method of connecting when not working with CRM Online?  Do i need to add an application to local ADFS?  I can't seem to find any guide or documentation on this.  There must be a way??!!

*This post is locked for comments

I have the same question (0)
  • Hameed Hussain Profile Picture
    250 on at

    Hey, Can you use the XrmToolKit to connect to the CRM. It asks you the url, if the deployment is IFD, the username and the password. If you can connect, build your connection string accordingly.

    I would suggest you try the following connection string:

    <add name="conn" connectionString="Url=crmorg.crmprovider.com/CRMORG; Username=myuser@domain.com; Password=MyPass; authtype=Office365" />

    I was stuck in a similar issue recently with Azure active directory authentication on Office365. The above url worked for me.

    You're just one step away. Try using a different authtype after you have tried the above url.

    Let me know.

    If the answer is helpful, please mark it as verified

  • Community Member Profile Picture
    on at

    In theory if i could construct a connection string to work with XRMToolKit that uses the same Tooling Connector method then i could connect that with OnPrem CRM365 and OnPrem ADFS - would be the same.  Anyone in here done that?  That's the bit i don't know.  

    I have tried all sorts of combinations of connection string.  Tried your suggestion above but no go.  I can't figure out if i need to maybe register an 'APP' in ADFS.  i have tried this kind of thing (found an article on powerobjects - www.powerobjects.com/.../how-to-register-a-dynamics-application-with-adfs) but don't quite have all the pieces to put together or know what i should be expecting.  Should my local ADFS pop up and prompt (like the Microsoft Sign In assistant does when you set up a connection string for Azure AD/CRM Online)?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hello,

    Could  you please replace the url with server name only.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans