---
title: "Set Up the Windows Desktop Client for Oauth (SaaS)"
app: "Warehouse Insight"
section: "Set up"
last_updated: "2023-03-13"
url: "https://insight-works.com/kb/warehouse-insight/set-up-the-windows-desktop-client-for-oauth-saas/"
---

# Set Up the Windows Desktop Client for Oauth (SaaS)

The _Windows Desktop Client Configuration for Oauth (SaaS)_ page details the steps needed to set up the Windows Desktop Client for Oauth (SaaS). Before you can begin setting up the Windows Desktop Client for OAuth (SaaS), you must complete the following steps:

1. Create a new Web Service record called “WMDM” in Business Central.
2. Obtain a valid license from support.
3. Navigate to the _Web Services_ page in Business Central.
4. Select **+New** and input information in the following fields:

   1. Object Type: codeunit
   2. Object ID: 23044900
   3. Service Name
5. Check **Published**.
6. Copy the SOAP URL for your service record in Business Central, if needed.

 Note: You also required the SOAP URL for the ServiceURL in the Web.config file (see below).

For more information on published Web Service, see [_Microsoft’s Publish a Web Service_](https://learn.microsoft.com/en-ca/dynamics365/business-central/across-how-publish-web-service) page.

### Configure Windows Desktop

1. Get the Warehouse Insight Desktop Client installer and the web service installer; copy these to an accessible location on your local machine.
2. Enable IIS features.
3. Turn on and install IIS features:

| – | ■ | Internet Information Services |
| --- | --- | --- |
| + |  | FTP Server |
| – | **✔** | Web Management Tools |
| – | **✔** | IIS 6 Management Compatibility |
|  | **✔** | IIS 6 Scripting Tools |
|  | **✔** | IIS 6 WMI Compatibility |
|  | **✔** | IIS Metabase and IIS 6 configuration compatibility |
|  | **✔** | IIS Management Console |
|  | **✔** | IIS Management Scripts and Tools |
|  | **✔** | IIS Management Service |
| – | ■ | World Wide Web |
| – | ■ | Application Development Features |
|  | **✔** | .NET Extensibility 3.5 |
|  | **✔** | .NET Extensibility 4.8 |
|  |  | Application Initialization |
|  |  | ASP |
|  | **✔** | ASP .NET 3.5 |
|  | **✔** | ASP .NET 4.8 |
|  |  | CGI |
|  | **✔** | ISAPI Extensions |
|  | **✔** | ISAPI Filters |
|  |  | Server-Side Includes |
|  |  | WebSocket Protocol |

1. Stop the IIS Server.
2. Run the Web Service Installer previously copied (creates files; go here to see these files).
3. Replace the WHILicense.txt file with the valid license file obtained from Support.
4. Modify the Web.config file in \\WebServiceInstall (See the _Web.config file table_ below):

   1. Match the partial key to the new one (provided by whomever generated a license).
   2. Match Company name and Environment name (under ServiceURL).
   3. Locate the Client ID, Client Secret, and Tenant ID in the Azure Active Directory Applications (how to acquire these values [here](/kb/warehouse-insight/azure-active-directory-aad-oauth-configuration-for-warehouse-insight-2-8/)).
   4. Set Authentication Mode (oAuth) to “5”.
   5. Set Client Credential Type to “None”.
5. Start the IIS server.
6. Open the Warehouse Insight desktop client as administrator.
7. Select **Options** (Configuration window opens on the _System_ tab).
8. Change your configuration code, web service, and company name to match your environment (change Web Service IP address to yours):

   - Configuration Code: Device configuration code from Warehouse Insight in Business Central.
   - Company Name: Company being used in Business Central.
   - Web Service: WebServiceInstall Application URL in IIS and ‘/EventManager.asmx’ (e.g. http://localhost/WebServiceInstall/EventManager.asmx).

 Note: Locate EventManager.asmx in C:\\inetpub\\wwwroot\\WebServiceInstall). Replace “localhost” with your computer’s IP Address. Retrieve the IP Address from your computer command line by running cmd.exe from Start and running “ipconfig” in the command line. Your IP address is under “IPv4 Address”.

1. Enter AAD Login under the _Logins_ tab (used for this client going forward).
2. Check **Always Maximize** under the _Device_ tab (maximizes the device screen).
3. Check **Connect BS via IIS** and uncheck **Enable Rebex Libraries** under the _Network_ tab.
4. Close and save settings.
5. Select **Remember Me** on the Login screen, enter your credentials, and select **Login**.

### Web.config File Table

You web.config file changes will look something like this:

| Authentication Mode | <setting name=”AuthenticationMode” serializeAs=”String”> <value>5</value> </setting> |
| --- | --- |
| Service URL | <setting name=”ServiceURL” serializeAs=”String”> <value> [https://api.businesscentral.dynamics.com/v2.0/XXXXX-tenant-ID-XXXXXXX/WHIWinTest/WS/ ](https://api.businesscentral.dynamics.com/v2.0/XXXXX-tenant-ID-XXXXXXX/WHIWinTest/WS/)XXXXX-%-encoded-company-name-XXXXXXX /Codeunit/WMDM</value> </setting> <setting name=”AuthorizationEndpoint” serializeAs=”String”> <value> [https://login.microsoftonline.com/{0}/oauth2/v2.0/token ](https://login.microsoftonline.com/%7B0%7D/oauth2/v2.0/token)</value> </setting> |
| Client ID | <setting name=”ClientID” serializeAs=”String”> <value> XXXXx-retrieve-from-azure-XXXXX<value> </setting> |
| Client Secret | <setting name=”ClientSecret” serializeAs=”String”> <value>XXXXXXXXXXX-keep-this-value-secret-XXXXXXXXX</value> </setting> |
| Tenant ID | <setting name=”TenantID” serializeAs=”String”> <value>XXXXX-retrieve-from-azure-XXXXX</value> </setting> </DMS.WHI.WHIService.Properties.Settings> <DMS.WHI.License.Properties.Settings> Partial key <setting name=”PartialKey” serializeAs=”String”> <value>XXXXX-retrieve-from-azure-XXXXX</value> </setting> |
| ClientCredentialType | maxBytesPerRead=”2147483647″ maxNameTableCharCount=”2147483647″/> <security mode=”Transport”> <transport clientCredentialType=”None” realm=””/> </security> </binding> </basicHttpBinding> </bindings> |

### Authentication or grant issues

If you receive authentication or grant issues, you need the tenant administrator with sufficient permission to open the _Azure Active Directory Applications_ page after they log into Business Central.

1. Navigate to _Azure Active Directory Applications_ in Business Central.
2. Select **New**.
3. Copy and paste your client ID to the _Client ID_ field and select **Grant Consent** (ensure popups are enabled).
4. Log in with a valid account.
5. Select **Accept** to accept the permission request.

When you select **Accept** and the tenant administrator selects **Accept**, “Consent was given successfully” message appears.

### Check errors

- If the login errors, check the IIS log. You can find the log under the Windows desktop client installation folder.
- Use Warehouse Insight Desktop Client in lieu of an emulator, as the scanner connects to Business Central in the same way as the Desktop Client (via IIS).
