Microsoft Outlook OAuth2 configuration
Submitted by tanderson on Mon, 03/04/2023 - 15:41
The following instructions can be used to configure a Mail Server that connects to Microsoft Outlook using OAuth2.
These instructions apply to the Email Document Loader Job as well, although the ports will be different.
1. In Administration - Organisation, create or edit a Mail Server
Enter the following details:
Name | Microsoft Outlook |
Description | Account settings for Microsoft Outlook |
Host | smtp.office365.com |
Port | 587 |
Timeout | 120 |
Connection Security | STARTTLS |
Authentication Method | OAuth2 - Outlook |
2. Click Authorise
The first time this is done, a New OAuth2 Client Registration window will be displayed.
This prompts for the following details:
- Tenant Id
- Client Id
- Client Secret
These are obtained in the following steps. Note the Redirect URI.
3. Log in to https://portal.azure.com/
Select Manage Azure Active Directory
4. Click App Registrations
5. Click New Registration
This displays a Register an application page.
Enter:
- Name: OpenVPMS
- Supported account types: Accounts in this organizational directory only (MSFT only - Single tenant)
- Redirect URI: Web, <Redirect URI from above> e.g, http://localhost:8080/openvpms/oauth2/code/outlook
6. Click Register
This displays an Overview page.
The Application (client) ID is copied into the Client Id field in step 3
The Directory (tenant) ID is copied into the Tenant Id field 3