OAuth 2.0 Client Credential Grant for Dynamics 365 Business Central

it_businesscentral 121 Reputation points
2021-02-22T07:47:25.113+00:00

Hi,

Wanted to create a windows console service that will run on the backend of a server to connect to my application and to Dynamics 365: Business Central.
Planning to use OAuth 2.0 client credentials to get token and consume business central endpoints.

Here are the following steps I have made so far:

Also tried the postman example provided inthe documentation, they, however, will return a token but not the correct one as it is unauthorized
https://login.windows.net/{tenant}.onmicrosoft.com/oauth2/authorize?resource=https://api.businesscentral.dynamics.com
https://login.windows.net/{tenant}.onmicrosoft.com/oauth2/token?resource=https://api.businesscentral.dynamics.com

GetAccessToken code similar to this https://api.codeproject.com/Samples/ClientCredCsDoc

Would really appreciate help here

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,389 questions
{count} vote

Accepted answer
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2021-02-22T15:01:16.157+00:00

    Hi @it_businesscentral · Thank you for reaching out.

    Could you please share what error you are getting while requesting for the token using Client_Credentials flow?

    I have provided a screenshot of the call from my tenant for your reference:

    70570-image.png

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful