Microsoft 365 OAuth: popup reports "account connected" but parent window shows "Authorization pop-up closed" and no account is created
Maintainers usually reply within 1 day
@ChristophWurst is already working on this.
Since Jun 16, 2026.
Assessment
This issue has not been assessed yet.
Description
Steps to reproduce
- Configure Microsoft OAuth in Groupware → Microsoft Integration (Client ID, Secret, tenant common). Confirmed saved and persisting after a hard reload of the admin page.
- Azure app registration: redirect URI is an exact, character-for-character match to https:///index.php/apps/mail/integration/microsoft-auth, registered under the Web platform (not SPA). Admin consent granted successfully.
- In the Mail app, add an account via the Auto path (email + placeholder password) → Connect.
- Complete sign-in and consent in the Microsoft popup; the popup reaches "Account connected / you can close this window."
Expected behavior
The account is created and the mailbox loads.
Actual behavior
While the Microsoft popup is still open and showing success, the underlying account-setup box in the parent window already displays "Authorization pop-up closed." After closing the popup, the Mail app returns to the login screen with no account in the sidebar — the account is never created. This appears similar to the symptom in issue #9159.
Mail app version
5.9.1
Nextcloud version
33.0.5
Mailserver or service
Microsoft 365 / Exchange Online (XOAUTH2)
Operating system
Linux
PHP engine version
Other
Nextcloud memory caching
No response
Web server
Apache (supported)
Database
MySQL
Additional info
Browser: Reproduces in Microsoft Edge with a clean/default profile, third-party cookies and popups allowed for the Nextcloud domain and login.microsoftonline.com. Also reproduces in Chrome.
Hosting: Managed Nextcloud (Cloudamo) — I do not have shell/occ access, and the in-browser admin log viewer shows no entries.
Additional context / already ruled out: Credentials are in the correct Mail-app panel (redirect URI path is /apps/mail/), saved server-side. Azure redirect URI is an exact match and registered as Web, not SPA. IMAP is enabled on the mailbox; admin consent succeeded after elevating the Azure role. Browser-side causes ruled out via clean Edge profile with cookies/popups allowed.
Given the "Authorization pop-up closed" message appearing before the popup completes, is this a known front-channel/callback handling issue, and what server-side configuration (e.g. overwrite.cli.url, overwriteprotocol/overwritehost, trusted_domains, or reverse-proxy rewriting of the /index.php/apps/mail/integration/microsoft-auth path) would cause the parent window not to receive the popup's result? I'm on managed hosting and would like to give the host a precise instruction if this is on their side.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 363
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 86
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextcloud/mail
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
nextcloud/mail#13841 · 1 comment ·
Maintainers usually reply within 1 day
-
0. to triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Show email next to name in Search dropdownPossibly taken @vansh-nagar claimed this 17 days ago. Open1. to develop enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
nextcloud/mail#13703 · 1 comment ·
Maintainers usually reply within 1 day
-
ISO-2022-JP emails are garbled in Mail 5.10.12 [Minimal fix available]Possibly taken @neconohitomi claimed this 37 days ago. Open1. to develop bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nextcloud/mail#13472 · 1 comment ·
Maintainers usually reply within 1 day
-
1. to develop technical debt
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
[quality] Nothing keeps docs/skills/manifest.md in sync with docs/skills/*.mdPossibly taken @hivecommons-hive claimed this today. Openagent/quality hive/covered-by-pr hive/hosted-available-lke648397-260827-5n31 quality testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
agent:blocked agent:ready
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
turbot/guardrails-fn#46 · 2 comments ·
Maintainers usually reply within 1 day
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 6 days