IMAP - Microsoft 365 - Setup Account¶
Zuar Runner uses OAuth 2.0 to gain access to the contents of your Microsoft 365 or Outlook.com mail. This requires the creation of an “app” in Microsoft Entra ID (formerly known as Active Directory) that can act on your behalf. Once the app has been created, the credentials associated with the app are used to authenticate Zuar Runner to Microsoft when your IMAP job(s) run.
Microsoft documentation describing how to do this can be found here and also here.
Note
You only need to create one “app” within Azure AD, regardless of the number of IMAP jobs you wish to create.
Once created, the “app” can be used by anyone with an email address in your organization.
Prerequisites¶
An Azure account that has an active subscription.
The account must have an administrator, or developer role assigned to it.
Register an Application in Azure AD¶
Signin to the Azure Portal.
If you have multiple tennants, ensure that you are in the correct tennant.
Search for and select “Microsoft Entra ID”.
Navigate:
Manage --> App registrations --> New registration
Name your applications
Select the correct account type.
Click
Register
The app’s Overview page will be displayed.
Make a copy the
Application (client) ID
(client_id
) andDirectory (tenant) ID
(tenant_id
). You’ll use these later when creating a job using the wizard.
Create Application Credentials¶
On the app’s Overview page, click
Certificates & secrets
.Click
+ New client secret
.Make a copy of the
Secret ID
(client_secret
) for later use.
Grant Permissions to Application¶
API Permissions¶
On the app’s Overview page, click
API Permissions
.Use
+ Add a permission
.Under
Select an API
, clickAPIs my organizaiton uses
.In the search box, type “Office 365 Exchange Online”.
From the list that is displayed, click on
Office 365 Exchange Online
.Under
What type of permissions...
, clickApplication Permissions
.Under
IMAP
clickIMAP.AccessAsApp
.Click
Add permissions
.Click
Grant admin consent for ...
to grant admin permissions toIMAP.AccessAsApp
.
Authentication¶
On the app’s Overview page, click
Authentication
.Under
Advanced Settings
, clickYes
forEnable the following mobile and desktop flows:
Click
Save
Microsoft Graph Permissions¶
On the app’s Overview page, click
API Permissions
.Under
API permissions
, clickMicrosoft Graph
.Select the following permissions:
email
offline_access
openid
profile
IMAP.Access.AsUser.All
User.Read
Click
Update Permissions
.
Confirm Permissions¶
When you are done, you should have the following permissions:
Credentials¶
You have successfully configured an app within Azure that can be used with Zuar Runner’s IMAP job.
You should have collected credentials similar to the following (the format is unimportant):
client_id = 9aef02cb-6efb-485f-91b8-ea57fda29d68
client_secret = utM8Q~xHAJt4PSCZzDKlL5P~WPgSlautR-VMrdsR
tenant_id=abdfa575-4bf4-4e51-878b-14e280eab912
You’ll need these credentials when you run the IMAP wizard to create an IMAP job. Instructions for doing that can be found here.