Troubleshoot Exchange Online OAuth2 Authentication for POP3 and IMAP Mailboxes
Question details
Identify and resolve OAuth2 authentication failures when an application connects to an Exchange Online mailbox using POP3 or IMAP.

- Product
- Microsoft Exchange Online and Microsoft identity platform
- Device & OS
- not provided
- Scenario
- An application needs authenticated POP3 or IMAP access to an Exchange Online mailbox using OAuth2.
- Observed behavior
- Authentication can fail because of incorrect app permissions, token configuration, expired access tokens, mailbox access settings, or SSL certificate validation errors.
Identify whether the application uses delegated sign-in or the client credentials flow, and collect the authentication error, tenant ID, app ID, and connection settings. Do not include access tokens, client secrets, or private keys in logs shared for troubleshooting.
Verify app permissions, consent, and mailbox authorization
Use this check when token acquisition or mailbox authentication fails after registering an application.
Open the application's authentication configuration and determine whether it signs in a user with delegated permissions or runs without a user using client credentials. Review Microsoft's documentation for authenticating IMAP and POP applications with OAuth before changing permissions.
In the Microsoft Entra admin center, go to Identity > Applications > App registrations, select the app, and open API permissions. For delegated access, verify the applicable Office 365 Exchange Online permission: IMAP.AccessAsUser.All or POP.AccessAsUser.All. For app-only access, verify IMAP.AccessAsApp or POP.AccessAsApp and grant the required administrator consent.
For an interactive delegated flow, open Authentication in the app registration and confirm that the redirect URI exactly matches the application's request. For client credentials, open Certificates & secrets and verify that the configured certificate or secret is valid; this flow does not use a redirect URI.
In the Microsoft 365 admin center, go to Users > Active users, select the mailbox user, and open Mail > Manage email apps to check POP or IMAP availability. For app-only access, also follow Microsoft's Exchange Online guidance to register the service principal in Exchange and grant it access to the target mailbox; Entra API consent alone is not sufficient.

Correct token requests and XOAUTH2 authentication
Use this solution when the application obtains a token but the POP3 or IMAP server rejects authentication.
Resolve TLS certificate failures and escalate unresolved errors
Use this solution when the connection fails during certificate validation or remains unsuccessful after permission and token checks.
Use WPS Office for Documents While You Troubleshoot Exchange Access
WPS Office is a free, lightweight alternative for document, spreadsheet, and presentation work, with a familiar interface and Microsoft Office format compatibility for easy migration. It does not repair Exchange OAuth2 authentication or replace a POP3/IMAP mail client.

Frequently Asked Questions
Why does POP3 or IMAP reject a token that was issued successfully?
Token issuance does not guarantee mailbox access. Check the token's audience and permissions, confirm POP or IMAP is enabled for the mailbox, and verify the application's XOAUTH2 request. App-only access also requires Exchange service-principal registration and mailbox authorization.
Can I use Microsoft Graph Mail.Read permission for an IMAP connection?
No. Microsoft Graph permissions authorize Graph API calls, not Exchange Online IMAP access. In Microsoft Entra admin center > App registrations > your app > API permissions, verify the applicable Office 365 Exchange Online IMAP permission instead.
Does the client credentials flow use refresh tokens?
No. When an access token expires, the application requests a new one from the token endpoint using its configured client credential. Check Certificates & secrets in the app registration if the credential has expired or been replaced.
Should I disable SSL certificate validation to get the mailbox connection working?
No. Check the configured hostname, certificate chain, trusted-root store, and any TLS-inspecting proxy. For Exchange Online, use outlook.office365.com with TLS on IMAP port 993 or POP3 port 995.
Can WPS Office fix Exchange Online OAuth2 authentication?
No. These failures must be resolved in the application's authentication settings, Microsoft Entra configuration, Exchange mailbox authorization, or TLS trust configuration. WPS Office can handle Office documents and downloaded attachments, but it is not an Exchange authentication repair tool.




