My “step by step” guide for implementing OData API authorisation in Business Central v17.x (Part 1)


Good news: the medieval webkey authentication for Business Central API has finally been deprecated.

In this first article I am going to present a little overview of the secure and modern OAuth protocol with a “delegated permission” sample.

In next article I will describe an “Application permissions” implementation for an application that runs as a background service or daemon without a signed-in user. I am going to describe how I refactored an existing Xamarin mobile application that is currently directly getting and posting data to Business Central APIs.


Login in Azure Portal , go to “All Services”, search “App Registration” and select “App registrations” list item.

Create a new registration.

Configure your application registration name and the redirect URI As Web with the URL “”.

Or even better “

Note down the “Application (client) ID” GUID, this is the “CLIENT ID” we are going to use in Insomia.

Select “API permission” blade,

Configure as in picture.

Go the “Certificate and secrets” blade.

Add a new “Client secret”

The “Client secret” and “Secret ID” will be generated,

Please notice that the “Client secret” is shown in clear text ONLY after the first generation and it will NEVER EVER be shown again. If lost you will need to generate a new one. There is not way to recover an existing “Client secret”.

Copy the “Value”, we are going to use it in Insomia as “CLIENT SECRET”.


Here are all mandatory parameters to make an OATH request:

Token-Name: Give the appropriate Token Name
Grant Type: Authorization Code

Callback URL:

Auth URL:<tenant_id>/oauth2/authorize?resource=
Access Token URL:<tenant_id>/oauth2/token?resource=

Client ID: Client ID as in “ID” column in azure
Client Secret: Client Secret Value as in “Value” column in azure.

By using Insomnia you easily test the API:

The well known Microsoft Azure AD web page appears asking for the username.

And the password.. and it’s done.


Olisterr Tech blog

Arend-Jan Kauffmann


24th of December, 2020

3 thoughts on “My “step by step” guide for implementing OData API authorisation in Business Central v17.x (Part 1)

  1. What about Grant Type as Client Credentials? It’s useless Grant Type as Authorization Code because you cannot automate between two applications


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s