Correct error message should be displayed based on the user's authentication source when an incorrect password is provided.
To Reproduce
Steps to reproduce:
- Set the AUTHENTICATION_SOURCES = ['internal', 'ldap', 'oauth2', 'webserver', 'kerberos'] in config_local.py or config.py
- Start the pgAdmin 4 and create a new user with auth source as 'internal'
- Try to log in using the newly created user but with the wrong password.
Expected behavior It should check the auth source of the logged-in user and show the correct error message. In this case user is 'internal', so it should throw "Incorrect username or password. 2 more attempts remaining"
Error message 'webserver authentication failed' when 'webserver' is set in the AUTHENTICATION_SOURCES list. 'LDAP configuration error: Port could not be cast to integer' when 'LDAP' is set in the AUTHENTICATION_SOURCES list and 'webserver' is not present.
If we set an OAuth2 user to inactive and then that user tries to log in, they cannot log in, but no error or warning message is displayed. It should show a message indicating that the user is inactive.
After extensive analysis and combining various authentication sources, resolving this issue has proven to be highly complex. Hence closing it.