Skip to main content

Guide: Business Central S2S Authentication

Do you use Business Central with Lagersystem? Then it's important that you follow this guide, to make sure the integration between the two systems keeps working when Microsoft introduces new rules for integration with external systems.

Follow the guide's three steps below, and you'll get safely through the setup. If you run into problems along the way, you can contact us or your Business Central consultant for help.

If you want to read more about the new rules, you can read more on Microsoft's website.

Step 1: Register Lagersystem as an app in Azure

Log in to Microsoft Azure with your Microsoft login (the same one you use to log in to Business Central): https://portal.azure.com/

Under the menu item Azure services, find App registrations and select it. If you can't find App registrations in the overview, you can find it by clicking More services.

Select the New registration button and fill in a name (e.g. "Lagersystem.dk"). Make sure you have selected the account type with the description "single tenant".

Under Redirect URL, enter the following: https://businesscentral.dynamics.com/OAuthLanding.htm

Once you have filled in the above, it should look like the image below.

Save the application.

The next thing you need to do is give the app the correct API permissions. Click API permissions in the menu on the left. Click Add a permission.

In the overview that appears, select Dynamics 365 Business Central. First click Delegated permissions and check all the available permissions (user_impersonation and Financials.ReadWrite.All), then click Add permissions at the bottom.

Click Add a permission again and select Dynamics 365 Business Central again. Now select Application permissions instead and check all the available permissions (app_access, API.ReadWrite.All and Automation.ReadWrite.All). Click Add permissions.

In the overview, you should now be able to see the following permissions:

Next, find the Certificates & Secrets page in the menu on the left. Then click New client secret:

When you create a client secret, you get a secret value. Save it, as it will be needed later. You can NOT see this secret again afterwards, so remember to save it!

IMPORTANT: When you create a new client secret, you can set an expiration date. We recommend setting this to 48 months. It specifies when this client secret (and thus Lagersystem's access) expires. It is your responsibility to keep this updated on an ongoing basis, so the integration with Lagersystem is maintained. It can be a good idea to note in your calendar that this needs to be updated periodically, e.g. every year.

Once you have your secret value, you need to find your Application (client) ID and Directory (tenant) ID.

You can find these two by going to the Overview menu item:

You should now have the three pieces of information we need for the next steps: your Client ID, Tenant ID and Client secret (secret value).

Step 2: Enter the information in your Business Central

Open your Business Central and search for "Entra" (the search field is in the top right corner).

Select the menu Microsoft Entra Applications:

Here you need to enter the following (as shown in the image):

  1. Enter your Client ID in the Client ID field. You can also write "Lagersystem" in the Description field. Also make sure that State is set to "Enabled".
  2. Under User Groups, select D365 BUS FULL ACCESS.
  3. Under User Permission Sets, select D365 AUTOMATION, D365 FULL ACCESS and SUPER (DATA) as permissions.
  4. Save by clicking Grant Consent.

Step 3: Add the app user as a warehouse worker

In your "Microsoft Entra Application Card", which you have open, find the username under "User Information" and copy it:

Search for "Warehouse Employees" in BC (the search field is in the top right corner) and go to that setup page.

Add the username you just copied from the application card here (it cannot be found in the user list and must be pasted in).
Remember to set a location code, if access is locked to a specific location.

Step 4: Enter the information in your Lagersystem

The last step is to enter your Client ID, Tenant ID and Client secret (secret value) into your Lagersystem.

Log in to your Lagersystem and go to Setup -> General Setup.

Under the API tab, you'll find your Business Central setup. Here you need to enter the three pieces of information under the App Token menu.

Remember to click Save settings at the bottom of the page, and you're done!