OIDC login failed and Web bundled resource issue after migrate to v1

Issue Description

  1. The migrate tool (docker compose) succeed with no error, but the downloaded resource pointed to an old version, which is the v1 web resource.

stalwart | 2026-10-30T07:41:09Z ERROR Resource error (resource.error) reason = Resource error (resource.error) { causedBy = "crates/common/src/manager/application.rs:655", url = "https://github.com/stalwartlabs/webui/releases/latest/download/webui.zip", details = "Application bundle does not contain a manifest" }, url = "https://github.com/stalwartlabs/webui/releases/latest/download/webui.zip", details = "Failed to unpack application for prefixes: account, admin, no bundle is available to serve"

  1. OIDC connect failed when I login with my account with external OIDC provider.

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

It was good in v0.16.

Stalwart Version

v1.x

Installation Method

Docker

Database Backend

MySQL

Blob Storage

Filesystem

Search Engine

Internal

Directory Backend

OIDC

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

Anyone want to rollback to the v0.16, it is not enough just change the config path to the old.

In my case, the config and database switch with no error, but the web behavior leads to an oidc failure (same as 2.x). Maybe the ‘latest’ is ‘2.x’ now. I have to change the resource url to https://github.com/stalwartlabs/webui/releases/download/v1.0.11/webui.zip

Refer to how to edit the resource url Stalwart 1.0.0: Can't get to the WebUI (Resource Error: Application bundle does not contain a manifest)

Fixed command if you install the latest stalwart-cli:

stalwart-cli query Application # to get <YOUR_APPLICATION_ID>

#stalwart v1 web ui
stalwart-cli update Application <YOUR_APPLICATION_ID> --field resourceUrl=https://github.com/stalwartlabs/webui/releases/download/v2/webui.zip

#rollback to stalwart v0.16 web ui
stalwart-cli update Application <YOUR_APPLICATION_ID> --field resourceUrl=https://github.com/stalwartlabs/webui/releases/download/v1.0.11/webui.zip

stalwart-cli create Action/UpdateApps # to redownload the bundle, or restart the Docker container.

Extra info. On the latest web ui, the [email protected] cause the oidc failure, while the local admin account failed with the same msg. It should be admin:password login instead.

Recovery mode not helpful.

Hi,

The bundle URL you found is the right one for v1: https://github.com/stalwartlabs/webui/releases/download/v2/webui.zip is what a fresh v1 install uses, and latest now resolves to 2.0.3 as well.

The OIDC error comes from a change in WebUI 2.x. It no longer has a built-in client id. When it signs in at an external provider, it uses the client id set in the Application’s oauthClientId, or, when that is empty, the URL of its Client ID Metadata Document, which only works if the provider advertises client_id_metadata_document_supported. Your provider doesn’t, and oauthClientId is empty, so you get that message. Register a public client for the WebUI at your provider (redirect URIs https://<host>/admin/oauth/callback and https://<host>/account/oauth/callback, PKCE with S256) and set its id as oauthClientId:

stalwart-cli update Application <YOUR_APPLICATION_ID> --field oauthClientId=<client id at your provider>

The details are in Client id of the WebUI and the provider checklist below it.

For the local admin: the login page sends a name with a domain to that domain’s directory, so an admin account named something@yourdomain also goes to the external provider. The recovery admin, or an account without a domain, signs in through Stalwart’s own login page. Once oauthClientId is set, Stalwart’s own authorization server also needs a first-party OAuthClient with that same client id, otherwise those logins fail with Unknown client id (the note in the same docs section covers this).

Thanks for the update. I have more questions now.

  1. The resource url for v2 is no longer available. Did you change it? https://github.com/stalwartlabs/webui/releases/download/latest/webui.zip, what is the correct url then?
  2. Based on your answer, I will need to configure following extra items before running the v1 stalwart:
    1. Create an oidc client from Management → Directory → Oauth clients. And create the first-party client for the built-in web ui
      1. What are the redirect urls for the first-party?
      2. If the admin account is blocked outside due to an incomplete setup configuration, any steps?
    2. Configure the client id for built-in web ui from Settings → web application → current default web interface → Oauth Client ID
      1. Is the web ui Oauth clientID same as the OIDC Directory’s (external oidc provider)? If so, then the external oidc provider should configure without the client secret. If not, we can configure one to protect the backend.

Any of them blocks the admin/user from logging to the stalwart. It’s kind of the ‘trusted networks’ settings behind the reverse proxy. Since these configurations are extreme important, please HIGH LIGHT and guide the user with more details. And the migration program should fix and add these items when asking the questions.

I logged in with 0.16 and hold the browser tab when switching to the v1 , and added these settings with luck. All these mentioned cliend id are same. However, I guess they are independent.

Hi,

The bundle URL didn’t change. releases/download/latest/webui.zip has never been a valid GitHub path, which is why it 404s. These two both work, and today they serve the same 2.0.3 bundle:

https://github.com/stalwartlabs/webui/releases/download/v2/webui.zip
https://github.com/stalwartlabs/webui/releases/latest/download/webui.zip

The first is what a fresh install uses, and it follows the 2.x releases.

On the client ids, oauthClientId on the Application, the client at your provider and the first-party OAuthClient in Stalwart must all be the same id. They’re the same client seen from three places. The WebUI runs in the browser and can’t keep a secret, so that client has to be public, both at the provider and in Stalwart, and PKCE takes the place of the secret. If you want a client with a secret, that’s introspectionClientId and introspectionClientSecret on the OIDC directory. It’s a separate client at your provider, only used when opaqueTokenValidation is set to introspection.

The redirect URIs of the first-party OAuthClient are the same two you register at the provider, https://<host>/admin/oauth/callback and https://<host>/account/oauth/callback. Turn on firstParty and leave the secret empty. If you also add https://<host>/admin/login and https://<host>/account/login as post-logout redirect URIs, logging out returns to the login page; without them you land on the plain signed-out page.

Order matters on a fresh switch, and it avoids the lockout you ran into:

  1. Set STALWART_RECOVERY_ADMIN=<username>:<password> in the container environment and restart. It’s accepted in normal operation, no recovery mode needed.
  2. With stalwart-cli, using those credentials, create the first-party OAuthClient.
  3. Set oauthClientId on the Application.
  4. Remove STALWART_RECOVERY_ADMIN and restart.

The CLI signs in with the password directly, so if the WebUI is already locked out with Unknown client id, the same steps still get you back in. No need to keep a 0.16 tab open next time.

The 1.x WebUI used the id stalwart-webui when none was set, so if that was your setup on 0.16, that client already exists at your provider and you can reuse the id.

The upgrade guide should have called this out and it didn’t, so I’m adding a section on it. Having stalwart-migrate prepare ask about the client id would be a good addition: please post it in Feature Ideas with your experience, since it would have saved you this.

Thanks for sharing more details. I will update the bundle resource url later.

On stalwart 0.16.x with external oidc directory, the android app (sterna mail) ables to launch login flow with the built-in webui, it displays device code and after type the email address, redirects to oauth issuer to finish the flow.

I’m curious whether the built-in webui and stalwart discover endpoints can handle the case. For now, I configure the issuer url and client id in the android app to finish the whole flow.

I read this: Mail, calendar and contacts clients | Stalwart