Issue Description
I checked the documentation and existing topics, but I could not find a good way to handle this setup in the OSS version.
Environment
- Stalwart v0.16.5
- External OIDC provider: Kanidm
- Multiple OIDC clients using the same identity provider
Problem
I have a setup where multiple clients authenticate through the same external OIDC provider, but they represent different login flows and application contexts.
In practice, this means I need to use the same external identity source for more than one client, while still keeping those client flows distinguishable and reliable.
With the current OSS behavior, I was not able to connect multiple clients to one external OIDC directory in a way that felt correct and predictable. The configuration model seems too coarse for this kind of setup, because different clients may share the same external provider but still need to be treated differently during discovery and authentication.
Why This Matters
This seems like a common self-hosted scenario: one central identity provider such as Kanidm, but multiple applications or frontends that should authenticate against it as separate clients.
Expected Behavior
Stalwart should make it possible to use one external OIDC provider for multiple distinct clients in a practical and predictable way.
If several clients rely on the same external IdP, they should not be forced into a single indistinguishable authentication flow. Instead, Stalwart should behave in a way that allows these client flows to remain separable and reliable during discovery and authentication.
From a user perspective, the expected behavior is that a shared external OIDC setup can support multiple clients cleanly, without ambiguous matching, fragile behavior, or the need to model each client as a completely separate identity source.
Actual Behavior
In the OSS version, I could not find a clean and predictable way to use multiple distinct OIDC clients with one shared external OIDC directory.
In practice, the setup feels too coarse-grained for this scenario. Different clients can share the same external provider, but they still need to remain distinguishable during discovery and authentication. I was not able to model that cleanly with the currently available external OIDC directory behavior.
Reproduction Steps
- Configure Stalwart OSS with an external OIDC directory backed by Kanidm.
- Use the same external identity provider for multiple separate OIDC clients.
- Try to use those clients as distinct login flows or application contexts against the same external directory.
- Observe that this is not practical to model cleanly and predictably with the current OSS behavior.
Relevant Log Output
I do not currently have a concise log excerpt that demonstrates the issue better than the behavioral description above.
If needed, I can provide trace-level logs for a concrete test setup.
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
OIDC
Additional Context
I am currently evaluating Stalwart as part of a migration away from Mailcow, and this limitation came up during that process.
For additional context, I documented some of the implementation work I had to do downstream while trying to support this setup:
That downstream patch does work for my use case, but I am not linking it as the required upstream solution. I am only including it as evidence that this scenario led to non-trivial customization work on my side.
The Stalwart UI was not adapted as part of that downstream work, so the related configuration currently has to be managed through the CLI rather than through the web interface.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on