How can we create a custom user login flow. We need to query the database for user against a "username" and log him into Moodle without "password".
General developer forum
Create custom User Login Flow
Have you looked at the External Database authentication plugin? https://docs.moodle.org/31/en/External_database_authentication
You may get some mileage out of the "Internal" password format option...
Use 'internal' if you want the external database to manage usernames and email addresses, but Moodle to manage passwords.