Oauth2 - wrong username password

Steps to reproduce

  1. Install and enable Oauth2
  2. Log in to owncloud via desktop/mobile client
  3. Enter username, password and 2FA
  4. Authorise access

Expected behaviour

User should log in

Actual behaviour

“Wrong username password” error message

Server configuration

Operating system: Debian 11

Web server: Apache 2.4.54

Database: MariaDB

PHP version: 7.4.30

ownCloud version: 10.10.0.3

Updated from an older ownCloud or fresh install: Updated

Everything works fine with standard username and password login, but I cannot make it work with Oauth2.