Office 365 EWS OAuth configuration manual

Prerequisites:
- administrator account for the Microsoft Azure Portal,
- access to the Style desktop application with an account, which has access rights to change the system settings.

  1. Creating an application in the Azure Portal:
    1. Open the Azure Portal and search for "App registrations"
    2. Click "+ New registration"
    3. Give the application a friendly name, e.g. StyleMailApp
    4. Click register
    5. You'll be redirected to the new application's overview page
    6. Copy and save the values of the "Application (client) ID" and the "Directory (tenant) ID" fields
  2. Configuring application's API permissions (continues from above):
    1. Expand the "Manage" group in the menu on the left and select "API permissions"
    2. Click "+ Add a permission"
    3. On the newly opened panel on the right, select the "APIs my organization uses" tab
    4. Search for "Office" and select the "Office 365 Exchange Online"
    5. Select "Application permissions"
    6. Select the "full_access_as_app" in the "Other permissions" group and click the "Add permissions" button
    7. The new permission will be shown on the table, with the warning "Not granted for..." in the Status column
    8. Click on the "Grant admin consent for ..." button above the table and confirm
    9. Verify the "Status" column shows "Granted for" on the "full_access_as_app" row
  3. Creating a secret (continues from above):
    1. Select "Certificates & secrets" from the "Manage" group in the menu on the left
    2. Select the "Client secrets" tab and click "+ New client secret"
    3. Give a friendly description and select the desired validity (shorter validity will require creating a new secret more often)
    4. Copy and save the value from the "Value" column (not the Secret ID column!).
  4. Configuring the Style system settings for Style Web
    1. Open the Style desktop application
    2. Go to menu "Настройки\Настройки на СТИЛ Уеб\Системни"
    3. Select the "Имейл известия" tab
    4. Select the "Office 365 EWS" radio button
    5. Fill the "Directory (tenant) ID" and "Application (client) ID" fields with the values from step 1.6.
    6. Fill the "User" and "Имейл на подателя" fields with the email address of the mailbox that be used to send the emails from
    7. Fill the "Client secret" field with the value from step 3.4.