Your question
I’ve been experimenting with setting up an OIDC directory on v0.16 and gotten it to work, but wanted to share some of my experiences and ideas. I’m still not completely sure what is a bug vs expected behavior.
Setup
I have two domains:
- DomainA - with directory set to the OIDC directory
- DomainB - with no directory set (thus internal directory)
I set the Authentication Directory to the OIDC directory. This means I can only authenticate using OIDC for all accounts, no longer using internal directory for any accounts.
First issue
If I try to edit an Account in DomainB and change the password I get the error message:
Cannot change credentials for accounts in an external directory.
DomainB is configured to the internal directory, so this seems wrong. Is this a bug, or just a confusing message? The docs say
directoryId points to the Directory in which accounts for the domain are looked up. Leaving the directory unset falls back to the internal directory.
What is the meaning of “looked up” if not for authentication or editing credentials? Is this expected behavior?
Second issue
Accounts in DomainB do not exist in my OIDC IdP so I must rely on app passwords to authenticate these accounts for mailbox use.
However, in order to create app passwords to these accounts I need to enter the self-service portal:
- sign in to the account - not possible as they don’t exist in IdP and authentication is set to OIDC
- impersonate the account - doesn’t seem to work when I tried
user1@DomainB%user2@DomainAin WebUI, I just get signed in asuser2@DomainA
Did I miss any option?
Feature idea/request
What I would love to see and would make a lot of sense to me: instead of setting a single Authentication Directory globally, decide the authentication based on the domain of the account. user@DomainB gets authentication against internal directory, user@DomainA gets auth against OIDC.
The WebUI login flow already seems prepared for this given the initial discovery call that includes the account name - which should return the appropriate document based on the domain. I suppose that authentication through the other protocols would also work given the accounts now use the full email.
For my case, I could have my DomainB in the internal directory, e.g. with a dedicated administrator account or other service accounts, authenticating with Stalwart, and keep my regular users on DomainA using OIDC.
Is this already possible to do with multi-tenant setup?
Let me know if I misunderstood or missed anything that would have alleviated my issues!