I am working on a local network based on Windows, and I would like to use the account system of the network to allow users to connect to my DB.
As I understand the proper way is to set the pg_hba method on "ident" as such :
host all all 10.0.0.0/8 ident
But when I do so I get a message saying
"Error connecting to the server: FATAL: ident authentication failed for user <user>"
As far as I can think of it, my guess is that there could be two problems : - I do not properly set the pg_hba. - The role I created does not match the ident found by the server.
In the first case, could you tell if the syntax is correct ? I tried to add "sameuser" after the ident, but it corrupt my pg_hba, and also map=sameuser, but I get the same error as mentionned.
In the second case, I am using a batch run on every session to get the users names like
find /c "%username%"
or the Python3.6 function os.getlogin(), which produce the same result.
How does PostgreSQL get its "ident" ? And more importantly, how can I reproduce this process to know the idents of the sessions that PostgreSQL will recognize ?
Thanks.