Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

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,085 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans