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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

OAuth2.0 Multitenant application for Business Central

(0) ShareShare
ReportReport
Posted on by 5

Hi everyone.

My team is developing application that will have option to connect to Dznamics 365 BC.

We want to have following use case:

Our user want's to retrieve some data from BC API, such as Invoices, Customer info and Products. 

Our idea for connecting to API is that user uses his account to sign-in as user with Oauth2.0, we retrieve tokens and access API.

So now, my question is, is this possible to do if we create single Oauth2.0 Application on our tenant AD, and use client-id/secret in our application to authorize users.

Will our users be able to login with their credentials to access data that is on Business Central on their tenant?

Is this possible, or maybe we should use some other approach, like S2S or something else?

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

    Hello,

    Please take a look here:

    learn.microsoft.com/.../automation-apis-using-s2s-authentication

    Thank you.

  • Djordje Turjacanin Profile Picture
    5 on at

    We've studied S2S, and decided to go with it.

    Now, if I understood everything correctly. If we enable app for S2S to be multitenant, let's consider following example:

    We created App registration on our tenant A.

    Our first customer belongs to tenant B, he adds our app and grants consent to us.

    Our second customer belongs to tenant C, he adds our app and grants consent to us.

    When I request access token in my application, I will use login.microsoftonline.com/.../token and receive my token.

    How will I know for which customer to use API for,

    should I use api.businesscentral.dynamics.com/.../v2.0 URL together with my access token instead of

    api.businesscentral.dynamics.com/.../v2.0

    How do I differentiate between different customers/tenants?

    I've tried searching online, but couldn't find any resource explaining multitenant case for BC API with S2S.

  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

    The answer is written here:

    learn.microsoft.com/.../automation-apis-using-s2s-authentication

    Two main scenarios are enabled with S2S authentication:

    1. Company setup using automation API

    Automation APIs provide capability for automating company setup through APIs. The automation APIs are used to hydrate tenants, that is, to bring them to an initial state.

    The D365 Automation entitlements give access to APIs in the /api/microsoft/automation route by using the OAuth client credentials flow. An application token with the Automation.ReadWrite.All scope is needed for accessing Business Central Automation APIs.

    2. External user and non-interactive user access to APIs and web services.

    S2S authentication enables both external user and non-interactive user access to Business Central online. Refer to license guide for scenarios and usage. An application token with the API.ReadWrite.All scope is needed for accessing Business Central APIs and web services.

    The APP registration can be multitenant or singletenant.

    Hope it helps.

    Thank you.

  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at

    hi

    yes

    look this

    learn.microsoft.com/.../authenticate-web-services-using-oauth

    DAniele

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans