EzeScan Cloud

Authenticating with Microsoft Graph for Mailbox Importing

Our solution allows connectivity to Microsoft 365 mailboxes via the Graph API which is part of the Office suite of applications.

There are ultimately two pathways for enabling the connection of EzeScan Cloud to a mailbox and you must select one of them:

Inbuilt vs Custom Authentication Type

EzeScan WebApps has the ability to use a preconfigured Application Registration or allows you to create your own.

Inbuilt

The inbuilt OAuth registration is the quickest way to start importing emails from an Exchange Online mailbox.

In order to configure this mode, you will need to get a domain administrator to provide consent for our application registration to read and write data in your tenancy.

The Inbuilt OAuth registration is only able to use the Authorization Code grant type and is hidden from display.

Custom

A custom OAuth registration provides more granular configuration options around security as your administrator is able to manage all of the settings of the Application Registration in Azure.

In order to configure this mode, you will need a domain administrator to create a Custom Application Registration in the azure portal as well as provide you with the associated details to connect to that registration. They will also need to provide consent for your application registration to read and write data in your tenancy.

The Custom OAuth registration is able to use the Authorization Code and Client Credentials grant types.

Determining which Grant Type should be used

The connection to Exchange Online is utilising OAuth2 for authentication.

It is important to determine which grant type is going to be suitable given the level of functionality that will be required.

This integration supports the following grant types:

Authorization Code

In Authorization Code mode the application redirects to Microsoft for the user to login to their Office 365 account.

The user will see the very familiar Microsoft Login screen and after they login they will be redirected back to our application.

This process can also prompt users for MFA or block risky sign ins based on organisational settings in Microsoft Entra.

If the user is already logged in, or the browser has been configured with SSO then they are automatically redirected back to our application.

This grant type should be selected when:

  • The user account has access to the mailbox you wish to import emails from.

Client Credentials

In Client Credentials mode the application is authenticated using a client Id and corresponding secret.

Generally used for server-to-server or background communication.

The end user is never asked to directly Authenticate with Office 365.

This grant type should be selected when:

  • Multiple mailboxes need to be accessed using a single app registration.

  • Administrators want to enforce strict application-level permissions.

  • Only provide access to shared mailbox without also giving access to other personal mailboxes.

  • Remove the dependency on a specific user account which is better for server-to-server communication.

Allowing our Inbuilt Application Registration in Azure

Depending on the level of access provided to you a support engineer may need to grant you access to this configuration screen.

1

Select the Authentication Type of Inbuilt and then click the Authorize button.

image-20260610-122433.png

2

You will then be presented with a Microsoft 365 login window.

image-20260610-123248.png

3

After logging in you will be presented with a screen saying Approval is required. Enter the reason for the access and click request approval.

image-20260610-124718.png

4

You will then need to contact your administrator and have them action the request.

image-20260610-124821.png

5

They will need to navigate to the Azure Portal > Enterprise Applications > Admin consent requests and then click on the request for “EzeScan Office365 Connector”.

image-20260610-125147.png


6

Once the request has been approved you will be able to retry the authorize button and then see the status of Authenticated.

image-20260610-125656.png

Setting up Custom Application Registration in Azure

1

Navigate to the Azure Portal and select App registrations.

image2025-6-19_11-49-50.png

2

Click the New registration button in the top menu.

image2025-6-19_11-51-23.png

3

Enter the following details and then click the Register button:

Option

Value

Name

EzeScan Cloud

Supported account types

[Your tenant name here] only - Single tenant

Redirect URI

Web - https://customer.ezescan.cloud/ewa/administration/oauth/microsoftCustom (Replace "customer" with your deployed dns name).

image-20260611-034453.png

4

On the left menu click on the Authentication option.

image2022-5-4_9-23-4-.png

5

On the left menu select the API Permissions option.

image2025-6-19_11-59-3.png

6

Click the Add a permission button

image-20260611-034806.png

7

Select the Microsoft Graph option

image-20260611-034907.png


8

Select the Application permissions option

image-20260611-034948.png

9

Find and tick the Mail.ReadWrite permission and click the Add permission button.

image-20260611-035239.png

Note: Microsoft Entra ID application permissions grant tenant-wide access by default. To restrict an app with the Mail.ReadWrite application permission to a specific mailbox, you must use Role-Based Access Control (RBAC) for Applications in Exchange Online. This is managed via Exchange Online PowerShell. Role Based Access Control for Applications in Exchange Online | Microsoft Learn

10

Click the Grant consent for [Tenant Name here] button.

image-20260611-035654.png

11

Click the yes button on the window that appears.

image-20260611-035727.png


12

Click on the Certificates & secrets menu option on the left.

image-20260611-040140.png

13

Give the secret a name and set the expiration period then click the Add button.

image-20260611-040224.png

14

Copy the secret into and record it into a safe location as once you navigate away from this page it will no longer be visible.

image-20260611-040308.png

15

Navigate back to the Overview option.

image-20260611-041911.png

16

Copy the Application (Client) ID and the Directory (Tenant) and save them into the safe location used above.

image-20260611-040824.png

17

You should now have the 3 respective values saved out ready to send to our team.

image-20260611-041039.png


18

Send these 3 values to our team via a secure method of your choice.

For example:

  • Encrypted email or sharing an entry in a password manager.

  • Secure self-destructing message service (https://secret.ezescan.com.au/ )

  • Other method that adheres to your organisations policies for sharing sensitive information.