How to Troubleshoot Office365 IMAP AUTHENTICATE XOAUTH2 Failed

Question: We have an issue reading mail and we see the below error message in log Login: DllDate: Oct 27 2023 ChilkatVersion: 9.5.0.96 UnlockPrefix: *** UnlockStatus: 2 Architecture: Little Endian; 32-bit Language: *** VerboseLogging: 0 imapServer: outlook.office365.com loginX(2219ms): login: abc@example.com greeting: * OK The Microsoft Exchange IMAP4 service is ready. [***] authenticateXOAuth2(2219ms): xoauth2Imap(2219ms): ConnectionType: SSL/TLS ImapCmdSent: aaab AUTHENTICATE XOAUTH2 ImapCmdResp: […]

Office365 Modern Authentication for IMAP, POP3, and SMTP

This post documents how to implement Modern Authentication (OAuth2) for Office365 for the IMAP, POP3, and SMTP protocols.  The very first thing you’ll need to do is to create an “App Registration” in Azure Active Directory. See this Chilkat blog post for Instructions for Setting Up an App Registration in Azure for Modern Authentication for IMAP, SMTP, and POP3. It’s […]

Create Azure App Registration for use with IMAP, POP3, and SMTP

1) Go to https://portal.azure.com/#home and login to your Microsoft account. then go to Azure Active Directory.   2) Click On App Registrations * Copy your Tenant ID, you’ll need it later. 3) Click on “+ New registration” 4) Name your App and Click Register. Give it a name. For the Redirect URI, select “Web” and then use “http://localhost:3017/”. Your application […]

GMail IMAP NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

You passed the correct login/password to login to imap.gmail.com, but you still get an “Invalid credentials” error.  What gives? For example, you called Chilkat’s Imap.Login method, passing the correct login/password, and the imap.LastErrorText contains this: authenticateLogin(110ms): loginImap(110ms): ConnectionType: SSL/TLS ImapCmdSent: aaab LOGIN “you@gmail.com” getCompleteResponse(110ms): ImapCmdResp: aaab NO [AUTHENTICATIONFAILED] Invalid credentials (Failure) –getCompleteResponse –loginImap isOK: serverResponse: aaab NO [AUTHENTICATIONFAILED] Invalid credentials […]

GMail IMAP OAuth2 – A Walkthrough

This blog post covers from start to finish the process for getting a desktop application working with GMail using the IMAP protocol with OAuth2 authentication. Start here:  https://console.developers.google.com/apis/credentials (1) The first step is to create credentials.  Your app is a desktop application.  HOWEVER, you will be creating credentials as if your app is a web app. See this YouTube video […]

O365 IMAP Authentication: OAuth and MFA Solution

There is much confusion and worry about Microsoft’s plans to disable standard password authentication for the IMAP, and POP3  protocols. Here is the announcement posted on 20-Sept-2019 on the Office 365 blog: https://developer.microsoft.com/en-us/office/blogs/end-of-support-for-basic-authentication-access-to-exchange-online-apis-for-office-365-customers/ Chilkat already supports OAuth2 for the IMAP, POP3, and SMTP protocols. (Microsoft will continue to support basic auth for SMTP)  In all three protocols, an application can […]