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)

Connect Dynamics CRM to Asp.Net Core 2.0

(0) ShareShare
ReportReport
Posted on by

Can anyone refer me to documentation that shows how to connect an Asp.Net Core App to CRM online?

Things I found based on my research:

  1.  Web Api seems to be a logical way to get/query data from CRM.
  2. I haven't found a detailed document on how to get CRM to connect to Asp.Net Core application.

Thank you in advance.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    jlattimer Profile Picture
    24,562 on at

    You'll need to register an application in Azure and create an application user. The steps can be found here: https://crmtipoftheday.com/767/server-to-server-authentication-is-here/

    Once you've got that set up - here is some sample C# (not .NET Core but should be almost the same) that calls the Web API endpoint

    https://github.com/jlattimer/CrmWebApiCSharp/tree/master/CrmWebApiCSharpNoAdal

  • Community Member Profile Picture
    on at

    Were you able to connect Dynamics CRM to ASP.net Core 2.0? Can you even authenticate?

    I don't think you can with ADAL. Dynamics CRM requires you to use ADAL 2.0 because it is depended on Microsoft CRM SDK.

    Note

    Do not update the Microsoft.IdentityModel.Clients.ActiveDirectory assemblies to the latest version. Version 3.x of these assemblies changed an interface that the Microsoft.CrmSdk.CoreAssemblies depends on.

    but ADAL 2.0 requires <= .NET 4.6.2 therefore it will not work with ASP.net Core

    docs.microsoft.com/.../connect-customer-engagement-web-services-using-oauth

    docs.microsoft.com/.../use-multi-tenant-server-server-authentication

  • Community Member Profile Picture
    on at

    Yes, I was able to connect. Will be writing a blog post about it soon.

  • Community Member Profile Picture
    on at

    Nice! using ADAL?

  • Community Member Profile Picture
    on at

    OpenId.

  • Community Member Profile Picture
    on at

    Snippet:          

     services.AddAuthentication(options =>

               {

                   options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;

                   options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;

                   options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;

               })

                .AddOpenIdConnect(options =>

                {

                    options.Authority = "login.microsoftonline.com/domainName&quot;;

                    options.ClientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

                    options.ResponseType = OpenIdConnectResponseType.IdToken;

                    options.CallbackPath = "/auth/signin-callback";

                    options.SignedOutRedirectUri = "https://localhost:59073/&quot;;

                })

                .AddCookie();

  • Community Member Profile Picture
    on at

    Nice make sure you share the blog here so i can reference it

    Thanks!

  • Community Member Profile Picture
    on at

    Could you please tell me how were you able to connect asp.net core with Dynamic CRM?

  • Community Member Profile Picture
    on at

    Yes, you will have to use AAD authentication using bearer

  • Community Member Profile Picture
    on at

    Did you write the blog?

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