A cloud-based identity and access management service for securing user authentication and resource access
Hi Jan,
Thank you for posting your query on Microsoft Q&A.
The error “User is authenticated but not connected” when accessing Office 365/Exchange mail over IMAP and OAuth often indicates an issue on the tenant or mailbox configuration. While your app registration and OAuth flow with Outlook accounts may be correct, connecting to Azure-managed Office 365 mailboxes can require tenant-level changes.
Remediation Steps:
- IMAP Enablement
- Ensure IMAP is enabled for the mailbox user on the target tenant. Tenant admins can check and enable this in Exchange Online admin center under mailbox features.
- API Permissions
- Check your Azure app registration includes IMAP.AccessAsUser.All (Delegated) and the required SMTP.Send and Mail permissions, as shown in your screenshot.
- Confirm the permissions have been granted consent (admin consent may be needed in some tenants, even if not indicated in portal).
- Tenant Consent/Approval
- For delegated permissions, organizational users may need tenant admin consent. If users get “need admin approval” errors, the tenant admin should grant access to the required delegated scopes for your app.
- Conditional Access/Policies
- Review any conditional access policies or security restrictions on the tenant, which may block access for IMAP or specific clients. Blocking legacy authentication can affect certain IMAP flows, even for OAuth.
- Session/Rate Limits
- Office 365 IMAP implementation can lock out users if too many sessions are opened/closed rapidly. Wait a few minutes, disable and re-enable IMAP as a test, and avoid frequent reconnects during troubleshooting.
- Token Scope/Resource
- Ensure you use correct scope/resource in OAuth requests (e.g., use IMAP.AccessAsUser.All with https://outlook.office.com or https://graph.microsoft.com as appropriate).
- Mailbox Licensing
- Verify the mailbox account being accessed is licensed. Unlicensed/shared mailboxes or service accounts may not authenticate successfully through OAuth IMAP.
- Firewall/Network
- Confirm that IMAP (port 993) and SMTP traffic is allowed to Microsoft 365 endpoints from the client network.
- Check your Azure app registration includes IMAP.AccessAsUser.All (Delegated) and the required SMTP.Send and Mail permissions, as shown in your screenshot.
Please refer to:
Please "Accept as Answer" if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.