OAuth2 support for mail app
@ChristophWurst is already working on this.
Since Aug 10, 2026.
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
SSO for mail app with Oauth2/OpenId compatible servers (like Stalwart)
Cannot find a way to work with Oauth2/OpenID SSO.
OAuth2 against a third-party IdP should be possible
I have seen this https://docs.nextcloud.com/server/latest/admin_manual/groupware/mail.html#xoauth2-authentication-with-microsoft-azure-ad
but cannot find in my nextcloud (version mail app 5.7.0 and with groupware) a way to work with something else than Microsoft or Gmail
Describe the solution you'd like
What i want to do is using my mail server (Stalwart) which is OpenID compatible with SSO connection for my users:
IdP: Keycloak (with a client id and client secret)
Email Server: Stalwart (via its OAuth2)
Email client: mail app from nextcloud
Mail app redirects user to IdP for authentication, receives code, redeens into an access token, and uses access token.
My nextcloud already use OpenID for connection
Describe alternatives you've considered
No response
Additional context
No response
Contributor 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.
Assessment
This issue has not been assessed yet.