Roundcube Community Forum

 

Invalid scope while authenticating to Outlook with oauth

Started by TiffanyLynch, March 15, 2026, 03:24:36 AM

Previous topic - Next topic

TiffanyLynch

Hello. I want to use roundcube to access outlook. I created an oauth application in entra ID, assigned necessary permissions, copy-paste the example from defaults.inc.php file, and replaced the client ID and secret placeholders with my own. I was bounced back to login page, with an error (only shown in the URL,) `invalid_scope`. I checked the permission details for IMAP.AccessAsUser.All and SMTP.Send, turns out it's also within `graph.microsoft.com`. So i think the `https://outlook.office365.com/` part in oauth scope is not needed at all. I tried stripping that part, and finally got an oauth token, but i was bounced back to login page with no error reported even with debug_level set to 1. And i'm using roundcubemail-1.6.13-complete.tar.gz archive to deploy roundcube.

JohnDoh

Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

TiffanyLynch

So i asked on microsoft learn forum¹ about the issue, and from my understanding, the outlook.office.com scope is only for Exchange Online, which is paid and common in organizations. But he also mentioned that Exchange Web (API providing the outlook.office.com scope) is also in the process of being deprecated and moved to Graph API. So is the pull request you mentioned makes Outlook OAuth work with Microsoft Graph?
¹ https://learn.microsoft.com/en-us/answers/questions/5825132/how-to-add-permission-from-office-api-scopes