IMAP OAuth Regression: "User is authenticated but not connected" after successful token validation

Dean, Joseph (Cognizant) 30 Reputation points
2025-12-19T22:13:09.1666667+00:00

I'm reporting a regression in IMAP OAuth authentication for consumer Outlook.com accounts that started recently.

ISSUE SUMMARY:

IMAP connections fail immediately after successful OAuth authentication. The server accepts the OAuth token but returns a BAD response to the NAMESPACE command with the error: "User is authenticated but not connected."

WHAT CHANGED:

  • This was working correctly until recently (approximately early-to-mid December 2024)
  • No changes were made to my client code or OAuth configuration
  • Same implementation that worked before now fails consistently

TECHNICAL DETAILS:

Authentication Endpoint: https://login.microsoftonline.com/common

OAuth Scopes:

IMAP Server: outlook.office365.com:993

Account Type: Consumer Outlook.com (personal Microsoft account)

ERROR SEQUENCE:

  1. OAuth token acquisition - SUCCESS
  2. IMAP TLS connection established - SUCCESS
  3. OAuth AUTHENTICATE command - SUCCESS (token accepted)
  4. NAMESPACE command - FAILS with "BAD User is authenticated but not connected"

ERROR MESSAGE:

The IMAP server replied to the 'NAMESPACE' command with a 'BAD' response: User is authenticated but not connected.

WHAT THIS MEANS:

The IMAP server is accepting my OAuth token for authentication but then refusing to establish an authenticated session for subsequent IMAP protocol commands. This makes IMAP completely unusable despite having valid OAuth tokens.

IMPACT:

All IMAP operations fail. Users cannot access their email via IMAP despite successful OAuth authentication.

ROOT CAUSE:

This appears to be a server-side regression in Microsoft's IMAP service - specifically in how authenticated sessions are established after OAuth validation. The client implementation is correct and follows Microsoft's documented OAuth patterns.

REQUEST:

Please investigate recent changes to the IMAP service authentication flow. Something changed on Microsoft's backend that broke the connection between OAuth token validation and IMAP session establishment.

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.


2 answers

Sort by: Newest
  1. Elias Chedid 0 Reputation points
    2026-11-02T14:42:34.4666667+00:00

    Same issue on a personal Outlook.com account (legacy live.fr domain), still happening November 2, 2026. I tested it directly from the command line with a valid OAuth token (scope https://outlook.office.com/IMAP.AccessAsUser.All):

    • Out of 27 fresh connections with the same token, 19 succeeded (AUTHENTICATE OK, LIST, SELECT INBOX all fine). 8 failed with NO User is authenticated but not connected. as the reply to AUTHENTICATE XOAUTH2 itself.
    • It's the same on outlook.office365.com and imap-mail.outlook.com (~9/12 OK each).
    • It seems to depend on which front end the tcpproxy hands the session to (decoded from the greeting's BACKENDAUTHENTICATE tag). Failing: BN0PR02CA0044, MN0PR02CA0001, BN9PR03CA0291/0607/0616/0640, YT3PR01CA0022, YT4PR01CA0027. Always OK in my sample: MN0P222CA0024, BN9P220CA0018/0024, MN0P223CA0013/0021.
    • Clients like Gmail for Android open several connections, so one failure makes them report bad credentials. Outlook web and the Outlook app work fine.
    • Support cases 7109589050, 7109590715 and 7111004176 never reached anyone working on IMAP.

    Could someone on the Exchange Online / Outlook.com team check why some front ends can't connect sessions to the mailbox backend?

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Ferdinand Mütsch 0 Reputation points
    2026-07-25T21:03:32.74+00:00

    Got the exact same issue here! Would be great to find a solution for this.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.