WebAdmin login failed on v0.16.10: "identity provider does not support client metadata documents"

Your question

Environment:

Stalwart Version: 0.16.10 (Enterprise Edition)

Deployment: Linux systemd service using /etc/stalwart/config.json

Core Services: IMAP, SMTP, and mail delivery work without any issues.

Issue:
The Web Admin sign-in page suddenly stopped working, showing the following error in the browser:

“Sign-in is not configured: the identity provider does not support client metadata documents and no OAuth client id is configured for this application.”

Findings & Troubleshooting:

A curl request to /.well-known/openid-configuration returns 200 OK, but the JSON payload is missing “client_metadata_documents_supported”: true.

Added auth.idp.client-metadata-documents = true and session.oauth.client-id to config.json, but the OIDC discovery response remains unchanged after restarting the service.

Questions:

What is the recommended way to resolve this issue while staying on version 0.16.10?

Is there a specific configuration setting to force OIDC client metadata support or serve matching local v0.16.10 Web UI assets?

Thank you,
Martin Janda

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

I can’t give you a supported fix for 0.16.10, because the docs and source I have describe v1.0. The setting names you added (auth.idp.client-metadata-documents and session.oauth.client-id) don’t match anything I can find in the v1.0 schema. They also wouldn’t be read from a v1.0 config.json. In v1.0, config.json is only a small bootstrap file, and everything else is a registry object managed through JMAP.

In v1.0 the metadata-document policy is the clientMetadataDocuments field on the OidcProvider singleton. It is under Settings › Authentication › OIDC Provider in the WebUI. The values are disabled (the default), sameDomain and any. The docs say the server’s own web applications, including the WebUI, are recognised from the oauth-client.json in their installed bundle. That check is local and works whatever the policy is. So in v1.0 you shouldn’t need to enable the policy for the WebUI to sign in.

The error says the sign-in page expects the identity provider to advertise client metadata document support. I can’t tell from the docs why your 0.16.10 server doesn’t. One possibility is that the WebUI bundle is newer than, or doesn’t match, the server binary. I haven’t confirmed that, so treat it as a guess.

The way I can recommend to resolve this is to upgrade to v1.0, where the behaviour above is documented. The upgrade guide is here: Overview | Stalwart

Relevant docs for v1.0:

If you need to stay on 0.16.10, this isn’t covered in the docs I have. A community member or staff member should follow up on that.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Im not fully in the codebase but this got added at version 2.0.0 Blaming webui/src/services/auth/oauth.ts at main · stalwartlabs/webui · GitHub
Per default the applications get auto-updated so my best guess is that this happened.

You can try to overwrite it using the stalwart CLI:

{"@type":"upsert","object":"Application","matchOn":["description"],"value":{"application-i3f3aie2aaab":{"description":"Stalwart Web Interface","enabled":true,"oauthClientId":null,"autoUpdateFrequency":2592000000,"resourceUrl":"https://github.com/stalwartlabs/webui/releases/download/v1.0.11/webui.zip","unpackDirectory":null,"urlPrefix":{"/admin":true,"/account":true}}}}
``

Hi Martin,

@bkupffer has it. The WebUI application auto-updates from https://github.com/stalwartlabs/webui/releases/latest/download/webui.zip, and “latest” is now WebUI 2.x, which is built for Stalwart v1. On 0.16 it looks for client_id_metadata_document_supported in the server’s discovery document, which 0.16 never sends, so the error has nothing to do with your config. The auth.idp.client-metadata-documents and session.oauth.client-id keys you added don’t exist and can be removed.

To stay on 0.16.10, point the Application at the last 1.x bundle and force a fresh download:

stalwart-cli query Application
stalwart-cli update Application <APPLICATION_ID> --field resourceUrl=https://github.com/stalwartlabs/webui/releases/download/v1.0.11/webui.zip
stalwart-cli create Action/UpdateApps

The last step matters: 0.16.10 keeps the downloaded bundle in the blob store, so a plain restart would serve the cached 2.x copy again. If you can move to v0.16.27, that release pins the WebUI to 1.x by itself and refuses to load a 2.x bundle, so the next auto-update can’t break it again.

Thank you for the advice. I finally resolved the issue by upgrading to 1.0.1, and the WebUI admin authentication is now working as expected.

Thx, helped me as well.