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

How to Generate OAuth 2.0 Token for Business Central Docker VM API Requests?

(3) ShareShare
ReportReport
Posted on by 8

Hello,

I hope I'm in the right forum. I'm a developer using Business Central for learning purposes. I set up a BC VM locally using Docker with BcContainerHelper and am currently experimenting with web services.

When I use OData for simple POST/GET requests to my tables (one record at a time), everything works well. However, when I try to make more advanced API calls, such as batch requests or calling methods within a codeunit, I encounter issues with Basic Authentication.

Am I correct in understanding that OAuth 2.0 is required for these types of requests? If so, how can I generate an OAuth token? My research suggests setting up something in Azure, but I’m unsure if this applies only to cloud instances of Business Central or if it’s also available for local VMs like mine.

Thank you for your guidance!

I have the same question (0)
  • JH-14111136-0 Profile Picture
    4 on at
    "Hello Wy11,
     
    I can only partially answer your question. We're working with a SAAS (cloud) environment and in our case we indeed do need a Oauth token. We take these steps:
     
    The response is a json with this schema
     
    {
        "type": "object",
        "properties": {
            "access_token": {
                "type": "string"
            },
            "token_type": {
                "type": "string"
            },
            "expires_in": {
                "type": "integer"
            },
            "refresh_token": {
                "type": "string"
            }
        },
        "required": [
            "access_token"
        ]
    }
     
    • We create a new call to our requested endpoint, which has the header "Authorization"
    • This header has the value 'Bearer ' + the acces_token, which we've gotten from the first call.
    Hopefully this helps!
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,132 Super User 2026 Season 1 on at
  • Suggested answer
    Jainam M. Kothari Profile Picture
    15,805 Super User 2026 Season 1 on at

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 1,993 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,116 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans