So, there's conflicting information across the board here, so I need information here.
There's two problems at play:
1) MIcrosoft 365 is retiring the Outlook API.
2) Proper configuration of MS365 Application side of things
There's zero documentation on setting up the Enterprise Application side of MS365 for OAuth2 to work. Coupled with the issue that you require mail match with the UPN for authentication, it breaks when the application requires admin consent to use - and a known issue is that sometimes Enterprise applications cannot be consented to by standard users.
So, what's the proper way to configure the MS365 side of things to get OAuth2 + Microsoft 365 + IMAP working properly with osTicket?