Look at using the client credentials flow, the requirement and methods to use this are outlined in [https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth
how to get generate OAuth to receive e-mail for a legacy application running as a service
prakash anandaraj chinnappan
0
Reputation points
We have been using basic authentication for reading emails in a legacy application running as a service. Since basic authentication is no longer supported, the application is broken.
How should we go about creating the auth token to read email? We can't have any browser integration to generate the auth token.