Switching to Modern Authentication mode in MailStore

Microsoft have announced that Basic Authentication is being deprecated and that they will start turning this authentication type off on 365 tenants beginning October 2022.
MailStore version 13 onwards makes it possible for Microsoft 365 customers to tighten up their security by utilising Microsoft's Modern Authentication integration.
This article aims to explain what changes have been made in MailStore to support Modern Authentication and what the process is to convert a MailStore installation over from using Basic Authentication to Modern Authentication.
To begin lets first look at the two modes of authentication that can be used with Microsoft 365 and how they differ.