nextcloud / nextcloud/mail

OAuth2 support for mail app

Open
#12,491 6 comments 11 reactions 1 assignee View on GitHub

@ChristophWurst is already working on this.

Since Aug 10, 2026.

2. developing enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.