ℹ️ The Auron SMS Server is now Auron Omni. Learn more here.

How can we help?

Microsoft OAuth2. How to setup a client ID for use in desktop software?


Use this information when you connect to Microsoft Azure, Microsoft Outlook, or Microsoft Exchange using OAuth2 from a desktop application.

This applies to both the Auron Omni and the Auron E-mail Component.

Find more information about Microsoft OAuth2 endpoints and scope values.

Microsoft OAuth2 specifics

The client ID identifies your application in Microsoft OAuth2 services.

Normally OAuth2 also requires a client secret. However, Microsoft does not allow the use of a client secret in desktop applications. It is difficult to securely store secrets in a desktop application, and a third party could use a client ID and secret combination to impersonate your application.

You must also use the OAuth2 device code flow, which is designed for devices with limited input capabilities.

Create a client ID

Before you create a client ID, you need a Microsoft Azure account. If you do not have one, you can create it here.

The client ID is part of an application registered in Microsoft Azure Active Directory. The first step is to register a new application.

Follow these steps to create a client ID for your application:

1. Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.com).

2. Open the “Azure Active Directory” service.

Azure Active Directory service icon

3. In the left menu, click “App registrations”.

App registrations

4. You will now see a list of existing applications. At the top of the list, click “New registration” to create a new application.

New registration button

5. Fill in the “Register an application” form.


Register an application form

The application name will be visible when users sign in using OAuth2.

The supported account types depend on how you want to use the client ID. If you only need to authorize accounts within your own Azure environment, the first option is usually sufficient.

Since this is for a desktop application using device code flow, you can leave the redirect URL empty.

6. Click “Register” and locate the client ID.


Application client ID

The client ID is shown as the “Application (client) ID”.

Set to multi-tenant and allow public client flows

Go to the “Authentication” section under “Manage” to configure authentication settings.

1. Select “Multi-tenant”.

2. Enable “Allow public client flows”.

3. Click “Save”.

Select multi-tenant

Finished

That is it. You can now use the client ID in your OAuth2 desktop application.

Use device code flow and the “common” tenant option in your device code and token endpoints.