Fixes the authentication to postgres and ldap. refs #5147