We’re trying to connect personal Office 365 mailboxes to SuiteCRM 8 (Bitnami Docker image, PHP 8.1) using Microsoft OAuth 2.0.
The Azure AD app authorisation flow completes and tokens are issued.
⸻
What works
• Authorisation flow finishes when we request Microsoft Graph scopes
offline_access email IMAP.AccessAsUser.All Mail.Read …
SuiteCRM stores a valid access/refresh token in external_oauth_tokens.
• All other CRM functions appear normal.
What doesn’t
• If we switch to the Outlook-resource scopes required for IMAP/SMTP
https://outlook.office.com/IMAP.AccessAsUser.All
[…]
offline_access
the redirect to
index.php?entryPoint=setExternalOAuthToken
returns “Not able to get access token. Check logs for more details.”
• Keeping the Graph scopes instead lets the token be saved, but the personal mailbox wizard fails on Test Settings with
IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed.
Log excerpt:
ImapHandler:open: {outlook.office365.com:993/service=imap/ssl/tls/validate-cert/secure}INBOX
ImapHandler:open: user@example.com
IMAP open error: Can not authenticate to IMAP server: A0001 NO AUTHENTICATE failed.
Reproduction steps
- External OAuth Connection (Admin → OAuth Keys)
• Authorise / Token URLs: https://login.microsoftonline.com//oauth2/v2.0/…
• Redirect URI: https://crm.example.com/index.php?entryPoint=setExternalOAuthToken
• Scopes: see above. - Click Connect
• Graph scopes ⇒ consent succeeds, token saved
• Outlook scopes ⇒ “Not able to get access token”. - User Profile → Email Settings → Create personal mailbox
• Server outlook.office365.com, port 993, SSL, OAuth. - Click Test Settings ⇒ error shown.
⸻
Verified
• App has delegated permissions and admin consent.
• OAuth 2.0 access to IMAP/SMTP is enabled in the tenant.
• Container clock drift < 1 s.
• No conditional-access policy blocking legacy protocols.
⸻
Questions
- Does SuiteCRM require the Outlook-resource scopes (and not Graph) for IMAP/SMTP?
- Is the “Not able to get access token” error with Outlook scopes a known issue?
- Are there any workarounds or additional configuration steps we might be missing?
Happy to provide extra logs or test patches as needed.
Thanks for your help!
Best regards,