I see that Microsoft has rolled out OAuth 2.0 support for IMAP and SMTP recently.
What I understood from above link is that, "we need to use Graph API" for non-interactive applications using client credentials flow.
I have enabled the following permissions in my app Graph API permission settings
IMAP.AccessAsUser.All -> Delegated -> Granted admin consent
Mail.Read -> Delegated -> Granted admin consent
Mail.Read -> Application -> Granted admin consent
I gave my client ID, client secret and tenant ID details in my IMAP sample app code. Created confidential client app object.
Defined the scope to be "https://graph.microsoft.com/.default"
I have passed the access token to my IMAP object without any modification. It says "Server reported error: AUTHENTICATE failed (NO)." when I try to login.
Did I miss something here? Or Rebex doesn't support it yet?
Can someone guide me a way forward from here?