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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Access D365 Business Central API with Client Credentials Token

(0) ShareShare
ReportReport
Posted on by 60

Hello,

I need to access business central web services with oauth, as basic auth will be removed.

Although I believe that I've done all the steps required to use a bearer token for authentication, bc api requests fail with the following message:

"error": {
    "code": "Internal_ServerError",
    "message": "You do not have access to this object using an application as authentication.  CorrelationId:  XXX."
}

What I've done so far:

  • add application through azure portal
  • grant business central permissions (app access, automation, financials)
  • add azure application in business central and grant consent
  • grant super rights in business central

I want to use client credentials flow as a server application needs to access the business central api, where no user is involved.

To get the token, I'm using Microsoft Authentication Library (MSAL). That's my code (c#) where I get a token as response, but this token cannot be used failing with the error message above:

IConfidentialClientApplication app;
app = ConfidentialClientApplicationBuilder.Create(CLIENT ID)
       .WithClientSecret(CLIENT SECRET)
       .WithAuthority(new Uri(login.microsoftonline.com/TENANT GUID))
       .Build();

var scopes = new List<string> { "api.businesscentral.dynamics.com/.default" };
var result = app.AcquireTokenForClient(scopes).ExecuteAsync().Result;

Am I missing some configuration step in azure or bc?

I have the same question (0)
  • Suggested answer
    Marco Mels Profile Picture
    Microsoft Employee on at

    Hello,

    We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    dynamicsuser.net/.../developers

    I will open this up to the community in case they have something to add.

    You may want to use Postman as a tool to see if it does work that way.

    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,024 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,145 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 705 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans