Add support for trusted OAuth2 clients that skip the consent screen. #6895
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
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:


