Who can help with oauth2 access for my outlook?

Andriy Sedefer 0 Reputation points
2025-04-15T17:09:34.3233333+00:00

Please, who can help with access to my email with oauth2 imap access? I got an error:
{

src: 's',

msg: '5 BAD User is authenticated but not connected.',

cid: 'a9vn2mmfrelcgjvb9q0c',

nullBytesRemoved: undefined

}
in my ImapFlow lib client.connect();

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,829 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Hien-L 1,060 Reputation points Microsoft External Staff
    2025-04-18T09:22:02.5433333+00:00

    Hi @Andriy Sedefer ,

    Welcome to our forum!

    By research, this error may occur when using IMAP with OAuth authentication to access Office 365 or Outlook mailboxes. Below are some possible solutions:

    1. Make sure "IMAP4" is added to Client Access Rules in O365, and when testing the input in O365 using Jira context, the test is completed successfully. Client Access Rules in Exchange Online | Microsoft Learn 
    2. Complete the Authorize request using OAuth2.0 with username and password for the required email account confluence.atlassian.com Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    3. Check if the mailbox is disabled or hidden from the address list. For your reference: User is authenticated but not connected - Microsoft Q&A 

    In addition, we recommend that you post in the Microsoft Graph - Microsoft Q&A for more appropriate assistance.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

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