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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

dynamics 365 on premise Oauth2 grant types

(0) ShareShare
ReportReport
Posted on by 32

good day I have a grant type question .  we recently upgraded our AD to  ADFS4 , giving us more grant type options.  I would like to be able to use the client_credential grant type for all my WebAPI call from our legacy systems (using Layer7 ) for application to application communication.  I was able to get a ClientID (with client secret) create and generate a token (PowerShell script) but I keep getting an access denied error when trying to access any WebAPI endpoint . all the research that I've been able to find give me solution for dynamics 365 online using Azure AD . is there a way to connect to a on premise version (no azure involvement) using this grant type.  if so what do I need to do get it working 

I have the same question (0)
  • Suggested answer
    Satish Tiwari - CRM Profile Picture
    on at
    RE: dynamics 365 on premise Oauth2 grant types

    Hello Martin,

    You can explore below article and see if it helps.

    nishantrana.me/.../

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at
    RE: dynamics 365 on premise Oauth2 grant types

    Hello Martin,

    Please check out these articles.

    docs.microsoft.com/.../walkthrough-register-app-active-directory

    docs.microsoft.com/.../sample-authenticate-users-web-services

    Hope this helps.

    Regards

  • martin.carpenter Profile Picture
    32 on at
    RE: dynamics 365 on premise Oauth2 grant types

    good article but both refer to using the Authorization code grant type and I'm looking for a way to use the Client Credentials grant   . I have my client_id but all the documentation I'm for online, require me to register the client in the application.  that what I'm trying to figure out

  • martin.carpenter Profile Picture
    32 on at
    RE: dynamics 365 on premise Oauth2 grant types

    good article but both refer to using the Authorization code grant type and I'm looking for a way to use the Client Credentials grant   . I have my client_id but all the documentation I'm for online, require me to register the client in the application.  that what I'm trying to figure out

  • Pankaj Gogoi Profile Picture
    3,177 on at
    RE: dynamics 365 on premise Oauth2 grant types

    Hello Martin,

    This article talks about registering an app in AD FS and also granting permission.

    docs.microsoft.com/.../post-installation-configuration-guidelines-dynamics-365

    This article talks about Web API authentication with on-premise deployments

    docs.microsoft.com/.../authenticate-web-api

    This article talks about oAuth token with common data service. It also has sample code to get the token.

    docs.microsoft.com/.../authenticate-oauth

    Hope this helps resolving your issue.

    Thanks

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 > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 36 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans