Skip to main content

Unable to grant different authentication to different users

  • January 15, 2019
  • 2 replies
  • 10 views

ankitdm

We have a need to setup different authentication types for different users, mainly a "trust" type for the dbadmin from the localhost, and "hash" for all other users. I have created a new authentication for "trust" type and granted it to the dbadmin, which works fine (dbadmin doesn't get prompted for a password when logging in from localhost). However, I am unable to login using another user (reader1) from localhost via vsql, I get the following error:

vsql: FATAL 2248: Authentication failed for username "reader1"

I am able to login using the same user from a remote host using a sql client (DBVisualizer). I would have expected the "trust" type to be assigned to only the user I assigned to, and so rest of the users' authentication type should remain the default, isn't it? Am I missing something?

Thanks
-Ankit

2 replies

ankitdm
  • Author
  • New Participant
  • January 15, 2019

Ok, I found the solution (or so I think). Looks like once you define a hash authentication, it explicitly needs to be assigned to the user for 'local' to allow the user to also login locally using username/password.

Now onto my next test to configure TLS client authentication for a user (u1) when connecting from host1, and hash authentication when connecting from host2. Thats possible, right?


DaveT
Forum|alt.badge.img
  • Participating Frequently
  • January 15, 2019

Yes, once you establish authentications you need to ensure all users are covered and, yes, you can set up different authentication methods for different users.