+1 vote

We use Limilabs' Mail.dll. We were using the BestLogin method till now to connect with office 365 but as Microsoft office is switching to OAuth2 we need to use the OAuth2 method to connect. I tried to use LoginOAUTH2() method of the Mail DLL but it gives ImapResponseException with an error AUTHENTICATION FAILED.

I am passing Access Token which is received using "https://login.microsoftonline.com/" + {pstrOffice365TenantID} + "/oauth2/v2.0/token" with grant type - client_credentials.

Please let me know what is wrong here and why it is not working.

by (250 points)

1 Answer

0 votes

Following flows are supported:

OAuth 2.0 desktop with Office365/Exchange:
https://www.limilabs.com/blog/oauth2-office365-exchange-imap-pop3-smtp

OAuth 2.0 web flow with Office365/Exchange:
https://www.limilabs.com/blog/oauth2-device-flow-office365-exchange-imap-pop3-smtp

OAuth 2.0 password grant with Office365/Exchange:
https://www.limilabs.com/blog/oauth2-password-grant-office365-exchange-imap-pop3-smtp

OAuth 2.0 device flow with Office365/Exchange:
https://www.limilabs.com/blog/oauth2-web-flow-office365-exchange-imap-pop3-smtp

OAuth 2.0 client credential flow is now supported (since July 2022):
https://www.limilabs.com/blog/oauth2-client-credential-flow-office365-exchange-imap-pop3-smtp

Easiest to use for daemon/service apps would be the password grant one.

by (279k points)
edited by
...