Skip to content

Conversation

@h44z
Copy link

@h44z h44z commented Nov 4, 2025

Contribution Guidelines

What does this PR include?

Short Description

This PR adds support for marking OAuth2 clients as trusted. Trusted clients automatically skip the user consent screen during authorization, simplifying authentication flows for internal or pre-approved applications.

This is particularly useful when using Mailcow as an OAuth2 server for other applications such as Nextcloud or Seafile.
The feature request #4478 should also be solved by this PR.

Affected Containers

The change only affects the Mailcow web portal code and does not directly impact any containers.
To test the changes, overwrite the files in data/web/... and restart the php-fpm container.

Did you run tests?

Yes, I am using the proposed changes on my Mailcow instance in production.

What did you test?

  • I verified backward compatibility with existing Mailcow installations that do not include the new feature yet. For updated instances, OAuth2 clients remain untrusted by default, and the login and consent behavior is unchanged.
  • I tested both trusted and untrusted OAuth2 clients. For untrusted clients, the OAuth2 consent page continues to appear as expected. For trusted clients, users are redirected directly to the callback URL after logging in to Mailcow - no consent screen is shown in this case.
  • I validated the UI elements and translations (German and English). Creating and modifying clients works as intended, and switching a client between trusted and untrusted states functions seamlessly.

What were the final results? (Awaited, got)

The Mailcow UI for managing OAuth2 clients now includes a 'Trusted' flag, allowing designated clients to skip the consent screen. The underlying database table for OAuth2 clients has been updated to include a new column for storing the trusted status. Existing OAuth2 clients remain untrusted and the consent behavior is unchanged.

Screenshots:
image
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant