Connection of Microsoft Outlook Email Profile

A new Email Profile is created to connect to a Microsoft Outlook email profile.

The data is filled out according to the description on the General tab. The OAuth2 authentication type is selected.

To connect, you need to fill in the Client ID, Client Secret, and Discovery URL fields, and then do the following:

Enable SMTP support

Go to https://admin.microsoft.com/Adminportal/Home#/users and navigate to the Active users page. Select the user whose email will be used to process the emails (Fig. 1).

Active Users.png
Fig. 1. Active Users

Click on the display name. The account will open. Select the Mail tab (Fig. 2).

Account.png
Fig. 2. Account

Click on Manage email apps (Fig. 3).

Check if the Authenticated SMTP checkbox is selected. If not, select it and click the Save changes button (Fig. 4).

Registration of the OAuth client and generation of the secret key

Go to https://entra.microsoft.com/. Select App registrations (Fig. 5).

Click on New registration (Fig. 6).

Fill in the Name field. Select the Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) account type. In the Redirect URI, choose Web and enter the following in the field (Fig. 7):

https://XXXXX.XXX.XX/endpoint/oauth2/outlook/callback

Replace XXXXX.XXX.XX with the client's server.

Also, specify this link in the Discovery URL field on the General tab on the Webitel side.

Click the Register button.

An application is created. Copy the Application (client) ID data. Paste the copied data into the Client ID field on the General tab on the Webitel side.

Click Add a certificate or secret (Fig. 8).

The Certificates & secrets page opens. Click on the New client secret button (Fig. 9).

In Add a client secret, enter a description and click the Add button (Fig. 10).

The client secret is added. On the Certificates & Secrets page, copy the value of the created client secret (Fig. 11). Paste this value into the Client secret field on the General tab on the Webitel side.

Re-copying the client secret value is not possible!

Assigning permissions

On the application's page (Fig. 8), open API Permissions by clicking on the corresponding label in the Manage block. Click on Add a permission (Fig. 12).

The Request API permissions opens. Click on APIs my organization uses. Select Office 365 Exchange Online (Fig. 13).

Select the Application permissions (Fig. 14).

Scroll down, find and open IMAP. Select IMAP.AccessAsApp (Fig. 15).

Scroll down, find and open SMTP. Select SMTP.SendAsApp (Fig. 16).

Click the Add permissions button.

The Request API permissions closes. On the API Permissions page, click Grant admin consent for Webitel. A confirmation modal window will open (Fig. 17).

Click the Yes button.