Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

(0) ShareShare
ReportReport
Posted on by 15

My company has a Dynamics 365 On-Premises system using ADFS 2012 for authentication. We have created an ASP.NET Core 2.0 Application that is attempting to access the web API, but we have been unable to find any way to authenticate after trying many different options. Most of what we have found on the MSDN is for either the .NET Framework, or for authentication through Azure AD, but neither of those are relevant to our situation. If needed I can provide more details about the specific resources we have tried, as well as sample code. 

*This post is locked for comments

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Sorry. I did not say.

    I am using both 365 online and 2016.

    Trying to get this to work with 2016 on-premises.

  • Ryan_Ketcham Profile Picture
    Ryan_Ketcham 15 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    I don't believe one 365 environment can be both. By Online I mean it is hosted on Microsoft's servers, not on-premises. They are mutually exclusive. I do not know of an easy way to connect to the API of an on-premises, other than building your own API around the on-premises database, which you should access to.

    Hope this helps.

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Thanks....

    Yes... I am using 365 online as well.

    But I would like to get the on-premise working.

  • Ryan_Ketcham Profile Picture
    Ryan_Ketcham 15 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Hello,

    I do not believe we ever got this to work with On-Premises Dynamics. We ended up migrating to Dynamics 365 Online hosted CRM, so we were able to authenticate that way. They have stopped updating the On-Premises Dynamics and we had multiple issues that we needed to update to v9 to fix, which required migrating to Online. I would suggest migrating to Online if your organization is willing/able.

    Thanks,

    Ryan

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Hi Ryan,

    Any luck with getting this to work.

    If so,  could you post example.

     

  • Ryan_Ketcham Profile Picture
    Ryan_Ketcham 15 on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Hi Goutam,

    Thank you for your response! We have tried the method outlined in the article, but our issue is that we are running ADFS 2012, which does not support Application Groups. Therefore, we have not been able to generate a client secret to authorize our application. If there is some way to register an application in ADFS 2012 and generate a client secret, that would work, but we have been unable to find a way to do so.

    Thanks,

    Ryan

  • gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: Authenticating to Dynamics 365 On-Premises Web API from ASP.NET Core 2.0 web application

    Hi Ryan,

    I have found one article you may get  help from here -

    stackoverflow.com/.../authorize-webapp-to-adfs-in-order-to-access-dynamics-crm-web-api

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,575 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,493 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans